The big idea
The plug can only turn when nothing solid crosses the shear line, the thin gap between plug and housing. Each chamber holds a key pin and a driver pin, and springs push them down across that line. The right key lifts every stack to exactly the height where the split between its two pins meets the shear line. A wrong key leaves at least one stack too low or too high, so one pin still bridges the gap and the plug stays put.
Memory trick: “All splits on the line: the plug turns. One pin off: it stays shut.”
A bit of history: Locks with falling pins are very old. Wooden pin locks were used in ancient Egypt, and the type is often called the Egyptian lock: wooden pins dropped into holes in a wooden bolt, and a large wooden key with pegs lifted them out of the way. Some surviving examples are thought to be thousands of years old. In the 1840s Linus Yale Sr., a lockmaker in Newport, New York, patented a pin tumbler lock for safes using the same falling-pin idea. In the 1860s his son, Linus Yale Jr., developed the cylinder lock with a small flat key whose notched edge lifts each pin; his 1865 patent covers locks whose pins are set by pushing the key in. In 1868 he and Henry R. Towne founded the Yale Lock Manufacturing Company.
Keys for big wooden locks could be large, and Isaiah speaks of a key laid on the shoulder: And the key of the house of David will I lay upon his shoulder; so he shall open, and none shall shut; and he shall shut, and none shall open.
(Isaiah 22:22, KJV)