The US Standard railroad gauge (distance between rails) is 4 feet, 8.5 inches. That's an exceedingly odd number. Why was that gauge used? Because that's the way they built them in England, and the first U.S. railroads were built by English expatriates.
Why did the English people build them like that? Because the first rail lines in Europe were designed and built by the same people who built the pre-railroad tramways, and that's the gauge they used.
Why did "they" use that gauge then? Because the people who designed and built the tramways used the same jigs and tools that they used for building wagons, which used that same wheel spacing. Okay, why did the wagons use that odd wheel spacing? Well, when they tried to use any other spacing, the wagons were prone to breaking down on some of the old, long distance roads, because that's the spacing of the old wheel ruts.
So who built these old rutted roads? The first long distance roads in Europe were built by Imperial Rome for the benefit of their legions. The roads have been used ever since.
And the ruts? The initial ruts, which everyone else had to match for fear of destroying their wagons, were first made by Roman war chariots. Since the chariots were all made to certain specifications for or by Imperial Rome, they were all alike in the matter of wheel spacing.
Thus, we have the answer to the original questions. The United States standard railroad gauge of 4 feet, 8.5 inches derives from the original specification (Military, as it were) for an Imperial Roman army war chariot.
But one "nagging" question still remains. Why did the design of the Roman army war chariots incorporate that specific wheelbase?
Because the chariots were designed to be just wide enough to accommodate the back ends of two war horses.
So, the next time you are handed some odd ball specification and you assume that some horse's ass was responsible for coming up with it, you may be exactly right!