There are two different situations: making calls, and receiving calls. When I initiate a call, I talk to whatever cell tower is nearby, and I’m connected to the system, and for that stuff I’m not asking any questions.
The part that’s confusing to me is receiving calls. When someone is calling my call phone, how does the system know where I am. There are two possibilities: There is a central database, or there isn’t.
Possibility #1: There is a central database of all phone numbers
If there IS some sort of central database, then the caller [more specifically, the caller’s phone, or the caller’s cell tower, or the caller’s service provider, but let’s just use the term “caller” for simplicity] could ask it about my specific phone number, and it would tell the caller where my phone is located, or it could at least tell the caller who my service provider is, and then the caller would ask the same questions to my service provider, who has a their own central database, but only of their own customers. With all this information, the system knows how to route the call.
I imagine this was relatively simple when everything was a landline, and one company ran the phone system for each area. It got a little more complicated with the introduction of exchanges and area codes, but as long as it was just one company, it was manageable. When multiple phone companies were allowed, each bunch of 10,000 phone numbers in each area code / exchange were assigned to one specific company, and (if my memory serves me correctly) there definitely WAS a list whereby the system could look up any area code / exchange, and thus know who the service provider was, and the call would go through.
Possibility #2: There is no central database of all phone numbers (like some posters say)
But nowadays, even if I know your phone number, I won’t have a clue who your service provider is. You might have switched multiple times just in the last year. The phone number will give me a clue about where you live, but it is more accurately a clue about where you used to live when you got that phone number. And in any case, your number has no information about where the phone was located when you turned it on after your flight landed a few minutes ago.
So if there isn’t any central database, how does the system find a phone? The only way I can think of is by going through ALL the providers one by one, and asking each, “Is this phone number one of yours?” That will work okay most of time, because the vast majority of phones are serviced by a relatively small number of providers. [I’m being deliberately vague because (a) I don’t know what the numbers are, and (b) They don’t matter anyway,] But what if the target phone belongs to a small company, perhaps one that has been in business only a short while? There’s got to be a central database somewhere - if not of every single phone number, then at least of all the providers.