Have you ever wondered about:
What these keys were in the programming sense of things?
How can you take a random string consisting of numbers and alphabets and base the security of your system on it?
I have tried to explain just that using the example of actual physical lock and keys in this video:
Let me know in the comment section if that was helpful, Cheers!