NAT enhances network security by masking the private IP addresses of devices within a local network from the public internet. This adds a layer of protection against direct attacks on internal devices, making it more difficult for cybercriminals to target specific devices.