Public and private keys work as a pair in asymmetric encryption. The public key is available to anyone and can be used to encrypt information. The private key, however, is kept secret and is used to decrypt the information encrypted by the public key. This ensures that only the intended recipient can access the encrypted content.