Public IP addresses are globally unique addresses assigned to devices connected directly to the internet, allowing them to communicate with other devices across the world. Private IP addresses, on the other hand, are used within local networks (like home or office networks) to identify devices within that network, but they are not routable over the internet.