An Enigma is a set of wired wheels. Press a key and the current runs through the plugboard, then the right rotor, the middle, the left, bounces off the reflector, and runs back through all three — and one wheel steps, so the next letter takes a completely different path.
The right-hand rotor advances one position with every keypress, so it is sending the signal through a different piece of wire each time. When it reaches its notch it drags the middle rotor round by one; when the middle reaches its notch it drags the left. That gives 26 × 26 × 26 positions, and the machine's cipher is only different from the last one because of where the wheels happen to be sitting.
The stepping is the vulnerability. Before the war, the operators wrote the wheel positions on the message sheet and then destroyed it. Every day they rewrote the settings from a codebook, and every day the book was thrown away. A hundred days of that gives the Allies a hundred short cribs — and one crib, if the weather is right and the guess is good, is enough to rebuild the wheel positions and read everything that follows.
This is a working simulation with the historical wirings of rotors I, II and III and the UKW-B reflector, plus the standard double-stepping. Type on the physical keyboard or click the machine's keys, and the lampboard lights with the letter the signal produced.
Set the machine running, then read the rotor windows as they turn: that is the whole secret, and it is why the Germans were forbidden to use Enigma for anything they needed to keep for more than a few hours.