How do Common locks work?

Locks are nothing but special latching devices in which the secured bolt is released only by a specially designed tool, the key. In an ordinary door latch, a bolt is pushed into a hole in the door-frame, and is then secured by turning the key. A similar principle works in a padlock or the portable lock. However, in a padlock, a projection called tumble-bolt is pushed into a notch in the shockle and made secure by a special arrangement of levers. The levers are placed at different heights and the tumble moves only when all the levers are moved at once. Notches of different heights are made on the key such that they are in alignment with the levers of different heights. Thus, when the key is turned, all the levers are operated together and the tumble-bolt is moved into the groove in the shockle or out of it. By different combinations of the levers of various heights, each lock is made to open with a specific key.