system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: When one call 911, how is the call automatically local?

Hypothetically speaking, if someone is living in New York and they call 911, how does the call not go through a hospital in Los Angeles or other city from another state? How does the call automatically transfer to a local hospital in the area one lives in?
gpt
I feel very old having to explain this.

In the 1950s-1970s, there was no 911.  If you didn't know the phone numbers to your local ambulance service, police department, and fire department, you were SOL.  (Well, you could probably call the operator and hope that got you somewhere.)  If you bought a (landline) phone in the 1970s to mid-1990s it usually had a little card with a clear plastic cover, with a blue police car or shield symbol, red fire or fire truck symbol, and red cross symbol, for writing down phone numbers for police/fire/ambulance. When you bought a new phone you were supposed to fill these things out.  

In the 1960s-1990s, 911 service was rolled out throughout North America.  The idea was that when you dialed 911, your call would be automatically routed to whatever local authority (often a police station) agreed to service the block of phone numbers that includes yours.  No need to memorize numbers - no matter where you lived, you dialed 911 and got someone who could either help or direct you to help.  The rollout was very slow.  Emergency phone number cards and stickers were still a big thing for decades.
 
By the late 1980s, 911 service was almost everywhere, and it was no longer necessary to call your local FD/PD/EMS directly.  The 911 system was great - you made a call, and you got a 911 center assigned to your phone number.  The ubiquitous emergency stickers with police/fire/ambulance next to every phone slowly disappeared.

Then cellphones became a thing.  They operated in the same system - you called 911 and got a 911 center assigned to your phone number.  That might be on the other side of the continent if you were traveling.  

Enter Enhanced 911, or E911.  Under this system, the 911 system was improved, so that 911 calls weren't blindly sent to whatever police department claimed that block of numbers, but instead went to Public Safety Access Points (PSAP) with equipment and operators that could make sure the caller was physically in the region, determine what sort of emergency response was required, and redirect the caller if necessary.  For cellphone users, the tower used to make the call was encoded as metadata, and used to redirect the 911 call to the PSAP associated with the tower, *not* the PSAP associated with the phone number.

E911 has some additional features, such as the ability to poll your phone for location data, if your phone has GPS/AGPS enabled. This of course only works if your phone has an active and accurate location fix at the time of the call, and the PSAP has the equipment to poll that information.