This article is from the Locksmithing FAQ, by Joe "Spike" Ilacqua spike@indra.com and Henry Schaffer hes@ncsu.edu, major data collection effort by Scott Anguish sanguish@digifix.com with numerous contributions by others.
Visualize a door lock - there is a fixed block (the lock body or
cylinder) of metal with a cylindrical hole in it - the axis of this
hole is horizontal. It is filled with a "plug" which is the part
which turns with your key - and something attached to the rear of
the plug actuates the latch/bolt when you turn the plug with the
key. There are some small vertical holes drilled in both the plug
and the fixed block so they match up - and they are in a straight
line which is the same line as the key. Each hole (pin chamber)
is filled with (at least) two pins (small cylindrical pieces of
metal - except that the portion of the bottom pin which touches
the key is pointed) but the pins are of varying length, and there
is a spring at the top of the chamber so that the pins are pushed
away by the spring. The bottom pin is short enough so that it will
be pushed completely down within the plug and the top pin (imagining
right now there are just two pins - extra ones are only used for
master keying) goes from inside the top block to inside the plug.
Now the plug can't turn, because in each pin chamber there will be
a pin blocking the "shear" line - the line where the pin chamber
would "shear" apart when the plug turned.
You put your key in - and the different heights on the key are
made to "complement" the different lengths of the bottom pin so
that all of the bottom pins are raised up just to the "shear line"
between the plug and the fixed block part of the lock. Then
the key can turn the plug around its axis and actuate whatever
internal mechanisms are inside.
Picking a lock is a matter of raising the pins to the shear line, but
without the key.
 
Continue to: