Network Address Translation (NAT) allows for the substitution of one IP address for another at a network boundary. The most typical use of NAT is to provision RFC 1918 private addresses on a local area network and to exchange such addresses for public IP addresses at the network's edge.
Although the private-to-public address translation is most normal, NAT also allows the mapping of public-to-public or private-to-private addresses. Through the use of Port Address Translation (PAT), NAT can overload multiple inside host addresses onto a single outbound public IP address. Each host is assigned a unique source port number (at layer four) for each traffic flow, so even though return traffic to multiple hosts comes to the same public IP address on the network's edge, the NAT gateway can direct messages to the appropriate inside host.
The combination of NAT, PAT, and RFC 1918 vastly extended the effective life of the available pool of IPv4 public addresses, allowing for the deployment of hundreds or even thousands of devices behind a single public IP address.