You've learned how NAT and PAT solve the IPv4 address shortage.
IPv4 exhaustion drove NAT. With billion addresses and billions of devices, sharing public IPs became necessary.
Private addresses stay local. RFC 1918 defines non-routable ranges.
PAT is the workhorse. Thousands of devices share one public IP through port translation.
NAT breaks end-to-end connectivity. Some protocols need special handling.
Port forwarding enables hosting. Static mappings let external users reach internal servers.
IPv6 is the long-term solution.