Public key encryption
Here is a great video which shows principles for public key cryptography using colors, which makes it easy to understand for everyone:
https://www.youtube.com/watch?v=YEBfamv-_do

Now what you missed is that it is possible to generate a secret key, and give away something which enables encryption but not decryption. This is the principle of public key encryption.