A public IP is part of the internet's global routing table. Send a packet to a public IP from anywhere on the internet and it gets delivered to the device or NAT gateway that owns that address.
Private IPs (10.x.x.x, 172.16-31.x.x, 192.168.x.x) are reserved for use inside local networks. They're NOT globally unique — every home Wi-Fi has its own 192.168.1.x. The internet drops packets headed to private addresses outside the LAN that owns them.
The public/private split is why "expose localhost" is non-trivial. Your laptop has a private IP on your home Wi-Fi; the world can't reach it directly. Reverse tunnels solve this by relaying through a server with a public IP.