SSH keys provide a more secure alternative to logging into a private virtual server with SSH, compared to traditional login using a username and password. While a password can eventually be stolen with a brute force attack, SSH keys are almost impossible to crack using a brute force attack on its own.
Generating a key pair provides you with two long strings: a public and a private one. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When these two keys match, the system will unlock without the need to enter a key. You can increase security, even more, protecting the private key with a passphrase or password.