Wiring it into metal
A rotor is a substitution cipher you can spin — and that single mechanical fact changed cryptography for a generation.
The disc that thinks
A rotor is a thick disc, typically a few inches across, with twenty-six electrical contacts on each face. Inside, wires connect each contact on the entry face to a different contact on the exit face — one fixed substitution, soldered permanently into metal. Pass a current in at contact A and it emerges, say, at contact Q. The disc has done exactly what a Caesar or Atbash substitution does on paper, just instantaneously and reliably.
That alone would be unremarkable. What makes it useful is that the disc rotates. After each keystroke advances the mechanism by one position, the same input contact now aligns with a different wire path. The substitution the rotor performs is physically different from the one it performed a moment ago. String several rotors together in series — the current passing through each in turn — and the combined substitution becomes the product of all of them simultaneously. Advance the rightmost rotor one step and the entire chain produces a new alphabet. The machine is, in effect, a polyalphabetic cipher whose keyword is its own mechanical state.

The cascade of wheels
The elegance is in the carry mechanism. The rightmost rotor advances at every keystroke, just like the units digit of an odometer. When it completes a full revolution, it notches the middle rotor forward by one position. The middle rotor, in turn, eventually notches the leftmost rotor. Three rotors, each with twenty-six positions, yield 26 × 26 × 26 distinct states — 17,576 before the substitution sequence repeats. Add a fourth rotor and the figure climbs to 456,976. For a message of any practical length, the alphabet never cycles back within the text itself.
The wiring inside each rotor was the secret that manufacturers and militaries guarded. The physical arrangement of twenty-six wires is a permutation — one of 403,291,461,126,605,635,584,000,000 possible permutations of twenty-six elements. Not all of those were used, of course; the actual internal wirings were chosen at design time and fixed. What could change from day to day were which rotors were inserted, in what order, and what starting position each was set to. The rotor order and initial settings together defined the day's traffic, and without knowing them an interceptor faced an enormous search space even before considering any other variables the machine might include.
From patents to battlefields
The rotor principle was invented independently by several people in the early 1920s. Arvid Damm in Sweden, Hugo Koch in the Netherlands, and Edward Hebern in the United States all filed patents on closely related designs within a few years of each other. Arthur Scherbius, a German electrical engineer, purchased Koch's patent and developed the design into a commercial product he called Enigma — initially marketed to banks and businesses, later adopted and substantially modified by the German military. The Japanese built their own rotor machines; the Americans and British built theirs. By the Second World War, rotor machines were standard cryptographic equipment across every major belligerent.
The mechanical precision required was non-trivial. The contacts had to align reliably under field conditions, the stepping mechanism had to advance without slipping, and the wiring had to survive vibration, moisture, and handling by operators who were not engineers. That these machines worked as dependably as they did was a considerable manufacturing achievement.
What the rotor did not fix was the procedural layer above it. A machine that cycles through 17,576 states still repeats if the same settings are reused across multiple messages. The mathematics of the mechanism was sound; the habits of the operators were another matter entirely. The wiring was solid. The humans using it were not always so reliable.