The private file proves who you are by signing a challenge; the public line goes into the server’s authorized_keys. ed25519 is the compact modern type. The private file must be mode 0600.
SSH key pair
A private key you keep plus a public key you share, used to log in without a password.