How IP addressing actually works
Every packet on the internet carries a source and destination IP. Routers use those addresses to forward packets hop-by-hop until they reach the destination network, where the local gateway translates and delivers to the right device.
Modern networks layer two address families on top of each other: IPv4 for legacy compatibility and IPv6 for scale. Most production services serve both, and your operating system picks whichever is faster via a process called Happy Eyeballs.