End-to-end encryption: Secure messengers and messaging

End-to-end encryption is the most private and secure way to communicate online. End-to-end encryption (E2EE) is offered in most modern messaging apps, but how does it work?