NAT - Network Address Translation
Allows translation of private addresses into public addresses and vice versa for external communication. Multiple devices can be mapped to one public IP address.
When a package reaches the NAT device, it modifies the source IP (and L4 port if we’re talking about PAT) and creates a new entry of this mapping in the NAT table.
Mapping of the outgoing flow is called SNAT or Source Network Address translation, and the mapping of the incoming flow (external to internal) is called DNAT or Destination Network Address Translation.
Only for IPv4 type of addresses, since we have plenty of IPv6.
Besides, NAT provides security and ease of management. This way, the org’s network manages the private IP address, and the ISP assigns and manages the public ones.
PAT - Port Address Translation
Using ports for identifying the devices to achieve better scale.
Home routers use PAT to connect the devices in the home network to the Internet.