How SSH Key Authentication Works
When you connect to a server, it sends a random challenge. Your SSH client signs the challenge with your private key (never sent over the network). The server verifies the signature using your public key (stored in ~/.ssh/authorized_keys). This proves your identity without transmitting a password. Even if the connection is intercepted, the attacker cannot impersonate you without your private key file.