Virtual private networks (VPNs) provide a secure connection over public networks by encrypting data transmission. VPNs use encryption and authentication to securely transmit data across unsecured networks like the internet. There are two main types of VPNs - transport mode VPNs encrypt only the data portion of network packets, while tunnel mode VPNs encrypt the entire client packet.