Pins that block the turn
Most front doors use a pin tumbler lock. Inside a cylindrical plug sit several pairs of pins, one pair above each notch of the key. Springs push the pins down, and in the resting state the upper pin of each pair straddles the gap between the plug and its housing.
That straddling is the lock: the plug cannot rotate because pins bridge the boundary — the shear line — between plug and housing. Try to turn it without the right key and the pins jam harder against the sides.
The right key aligns them all
Slide in the correct key and its hills and valleys lift each pin pair by a different, exact amount. If the key matches, every pair splits precisely at the shear line: lower pins fully in the plug, upper pins fully in the housing, nothing bridging the gap.
Now the plug turns freely, and a cam at its back slides the bolt. A wrong key lifts at least one pair too far or not far enough, leaving a pin across the shear line — the lock stays shut. The key's pattern is a physical password, measured in fractions of a millimetre.
Five pins, thousands of keys
With five pin positions and, say, six possible depths for each, a lock system has 6 × 6 × 6 × 6 × 6 — nearly 7,800 — possible key patterns. Manufacturers vary pin lengths across their locks so that one key opens one lock and, by design, almost certainly no other.
Locksmiths can still open them by lifting pins one at a time with fine tools and patient listening — the mechanism whispers as each pin sets. Security therefore layers: good locks add oddly shaped pins that make that whisper lie.

