All marathons are the same length and almost nothing else about them matches. The variation between courses is large enough to outweigh the differences between athletes.
Elevation change is the dominant variable
Running uphill costs substantially more energy than level running, and the descent that follows does not return the difference.
A course with a net drop is therefore faster than a flat one, and a course with repeated climbs is slower than its total elevation change alone suggests.
Record eligibility rules limit how much net descent a course may have, precisely because unlimited drop would make times meaningless. A course losing height continuously would simply be a slower version of running downhill.
Turns cost more than they appear to
Each significant turn requires deceleration and reacceleration, and at marathon pace those transitions accumulate into a real cost across a course with many corners.
Courses run largely on long straight roads are consistently faster than city circuits with frequent direction changes, independent of elevation.
Record rules also cap the distance between start and finish, which prevents a point-to-point course being aligned with prevailing winds.
Surface and camber affect economy
Road surfaces vary in hardness and texture, and a smoother surface returns more energy per stride than a coarse or broken one.
Road camber, built in for drainage, tilts the runner slightly and loads one leg differently from the other over many kilometres.
Experienced athletes run the racing line to minimise both distance and camber exposure, which is a skill separate from fitness. Drifting wide through repeated bends can add a meaningful distance over the full race.
Weather dominates on the day
Marathon performance is highly sensitive to temperature, because heat production over that duration exceeds what the body can dissipate as conditions warm.
Cool, still, overcast conditions produce the fastest times, and a warm day can slow a field noticeably regardless of preparation.
Since races are held on fixed dates, weather is effectively random, which adds variation that has nothing to do with the course design at all.
Certification measures the distance, not the difficulty
Courses are measured by a defined procedure along the shortest legal route, and certification confirms the distance is correct or slightly long.
Nothing in that process assesses how hard the course is, so two certified marathons can differ enormously in the times they yield. Certification answers only whether the distance was correct.
This is why athletes and coaches speak about courses rather than times, and why a personal best is understood in the context of where it was run.

