A VPN works by connecting your computer, tablet, or smartphone to a server, so you can go online using the server's internet connection. The public WiFi network is only used to connect your device to the server, rather than to any of the websites or applications you subsequently access.