How do keys work? Explained in one Gif
Locks are a relatively simple a fun mechanism to play with.  Lock picking can be explained similarly.  It's essentially simulating that key by popping the pins up to the shear line (the horizontal plane) and applying tension via your tension/torsion tool so the pin doesn't fall down.  Then move onto the next one.  If you get all pins to the shear line, the lock opens.It's also a pretty cheap hobby to get into.  Though the legality varies by country/state so do check into that first if interested.