A digital signature works by using a pair of cryptographic keys: a public key and a private key. When an email is sent, the sender's email client uses the private key to create a unique signature for the email content. The recipient's email client then uses the sender's public key to verify the signature. If the verification is successful, it confirms that the email is indeed from the purported sender and that its content has not been altered.