system
Given the following post, respond as if you're commenting on Reddit:
human
eli5: how did trains in the 1800’s know they weren’t going to run into another train on the same track?

I’m watching 1883 (it’s amazing), and I’m wondering how trains in the Wild West days knew they were free and clear on the track they were on considering communication was very limited.
gpt
Originally originally, schedules. The railroads were one of the prime sponsors of consistent time keeping and proper time zones for exactly this reason...as long as everyone could agree on the time and who was going which way on which track at what time, everyone could stay out of everyone's way. This is why running the trains on time is a big deal...it's not just (or even primarily) about customer satisfaction.

Once we had telegraphs, stations could notify stations of changes: a train running early, or late, or stuck, etc. Thus it's not a coincidence that early telegraph cables very often followed train track...you had an existing right-of-way and one of the main people who wanted to use the telegraph were along the train tracks.

Once you had wires connecting stations, signals were easy to setup. The signals would tell the train if the next section of track ahead was clear or occupied. And that's basically where we're at today, with the additional of real-time monitoring of position. Some dense networks, like subways, use physical interlocks to stop trains from entering occupied sections but that's not very practical over very long distance networks.