E2EE works by encrypting messages on the sender's device and only decrypting them on the recipient's device. This process involves the use of cryptographic keys that are unique to the communicating parties. Only the sender and the recipient have access to the keys required to decrypt the messages, ensuring that no intermediary, including service providers, can access the plaintext data.