The marathon's official distance of 26.2 miles was set so the race could finish in front of British royalty.
Early Olympic marathons varied in length, generally somewhere around 25 miles, roughly approximating the legendary run of the Greek messenger Pheidippides. At the 1908 London Olympics, however, organizers set the start line at Windsor Castle so the royal children could watch the race begin, and extended the finish line inside White City Stadium so it would end directly in front of the royal viewing box.
That specific route measured 26 miles and 385 yards. The distance was inconsistent at the next few Olympics before it was formally standardized at that same 1908 figure in 1921, and it has been the official marathon distance ever since. In other words, one of the most iconic endurance distances in all of sport exists in its exact form largely because of where a British royal family happened to be sitting in a stadium more than a century ago.