Getting connected
A phone has no cable. It sends and receives radio waves with the nearest cell tower, a base station whose antennas cover one area, called a cell.
The base station turns your radio signal into ordinary network data, and back. In 4G it is called an eNodeB; in 5G, a gNodeB. It also shares the airtime fairly among every phone in its cell.
The tower is not the internet. A fibre cable, called backhaul, links it to the operator's core network: the central computers that run the mobile network and connect it to everything else.
When the phone switches on, it sends the identity stored on its SIM card. The core looks you up, then phone and network each prove they hold the same secret key. Only then are you let on.
Using the internet
The core gives your phone an IP address and is its doorway to the internet, much like a home router. Your request for a web page leaves the operator here.
The web server's answer comes back to the core. The core knows which tower you are under, so it sends the data down that backhaul, and the tower radios it to your phone.
Many cells
The car drives on. The phone keeps measuring both towers and reports that B is now stronger, so tower A hands your connection over to tower B. Your video keeps playing.
Radio frequencies are scarce: operators buy licences for a few slices. Because each cell is small, the same frequencies are used again in other cells. More, smaller cells let more phones share the same spectrum.
What 5G adds
5G can use much wider channels: up to 100 MHz in mid-band around 3.5 GHz, against 20 MHz for one 4G channel. Millimetre-wave bands, above 24 GHz, are faster still but reach only a few hundred metres.
5G can send in shorter time slots: 0.5 ms in mid-band, 0.125 ms in mmWave, against 1 ms in 4G, so the radio hop waits less. Distance still counts: light in fibre needs about 5 µs per kilometre.
What is going on, line by line
;; step 1/10 · radio · radio ;; your phone → tower a phone ⇄ tower A, by radio 4G: LTE radio (3GPP TS 36.300) 5G: NR radio, "New Radio" (3GPP TS 38.300) the phone listens for nearby towers and picks the strongest (cell sizes vary: a few hundred metres in a city, many km in the country)
The core is really many separate functions (in 5G: AMF, SMF, UPF, AUSF, UDM and more); a special topic opens it up. Many operators give phones an IPv6 address, or an IPv4 address shared between many phones through carrier-grade NAT.