Definition
A public IP is the main street address that lets anyone on the internet find your home or office, while a private IP is the unit number your devices use inside the building. One is a truly unique internet address, and the other is an internal address used only behind your router.
Street Address vs. Apartment Unit Number
If you order a package and only write the building's street address, the delivery driver can't get to your door. But if you only write "Apt 101," nobody knows if you live in New York or Los Angeles.
The computer world works the same way. For every computer on Earth to talk to each other, each one needs an address that is unique worldwide. That's called a public IP address. The single internet line your provider (like Comcast or Verizon) connects to your home gets one of these.
But if every laptop, smartphone, tablet, and smart TV in your home got its own real address, the internet would run out of addresses fast. So we put a gatekeeper in place: the router. Devices on the inside share private IP addresses, which often start with 192.168. Some private addresses start with 10 or with 172.16 through 172.31.
Your Router Swaps the Address for You
When you tap a YouTube video on your phone, the phone sends the request to your router with its private IP attached. The router takes that request, wipes off the phone's private address, and dresses it up in the router's own public IP before sending it out to the internet.
From YouTube's point of view, it never sees your phone. It only sees the building's main address, which is your router. When YouTube sends the video back, it delivers it to your router's public IP. Just by looking at that IP address, nobody can tell how many devices you have at home.
When the data arrives, the router checks its own notebook and thinks, "Oh, this is what the phone in the living room asked for a moment ago." Then it hands the data to the right private IP. This clever address-swapping trick is called Network Address Translation (NAT).
A Little More Precisely
To be a bit more precise, a computer with a private IP sits behind a one-way shield. Sending requests out and getting answers back works fine. But if a friend from the outside tries to connect straight to your computer, they get stopped at the router's front door.
That's because the outside internet has no way to find the "unit number" inside your home. So if you want to host a game server or run a personal web server from a home computer, you have to tell your router to set up a pathway that sends outside requests to one specific computer.
This technique is called port forwarding. In the end, the private IP system is an economical way to save scarce IP addresses, and it also gives you a side-benefit of protection by blocking connections that start from the outside. Still, NAT wasn't designed for security, so it's no substitute for a firewall.
Common misconceptions
Every device on my home Wi-Fi has its own different public IP.
With IPv4, your phone, laptop, and TV all share one single public IP through the same router. With IPv6, which has plenty of addresses, each device can sometimes get its own outside address. The different numbers you see per device are private IPs, which only work inside your router.
Where you meet it
The '192.168.0.1' you often see on your router's admin page is the router's own private IP address.
If you're on home Wi-Fi and Google "what is my IP," you won't see your phone's private IP. You'll see the public IP the outside internet sees, which is usually your home router's address. If you search on mobile data instead, you'll see an address assigned by your mobile carrier.
In one sentence
A public IP is your one unique main address on the internet, and a private IP is the internal unit number that tells devices apart inside your router.