Each rotor has an ordered alphabet of length
at the bottom and a permutation of the alphabet on top. On every rotor, for every letter X, there is a wire connecting X at the bottom to X at the top. Every letter at the top of the
rotor is connected to the bottom letter just above it in the
rotor or to the point just above it in the reflector, if the
rotor is uppermost. In the reflector, there are
wire connections between positions (i.e. positions in reflectors are matched in pairs).
When a letter is input to Enigma, the electricity goes through the wires described above (red line in animation). The coded letter is the letter where the electricity leaves the Enigma. After each coding, the rotors are rotated according to the rules. For every letter on each rotor there is a rule that gives the rotation after the coding if electricity goes through this letter. Every day the starting positions of the rotors were changed. You can set the starting position randomly by pushing the button.
When you let time go by slowly, you can see how the electricity passes through the Enigma machine during encryption and how the rotations happen. The last green letter of the picture is the letter that is currently encoding and the red word is the code up to that time. When electricity is in the rotor, the letter on this rotor is figured out on the side. This letter is important when the rotations take place.
Thanks to the reflector, if X is encrypted to Y (given a position of the rotors), Y is encrypted to X (with the same position of the rotors). This ensures that, with a given starting position of the rotors, encrypting some encrypted text will return the original text.
A detailed description of the Enigma machine is given by Graham Ellsbury .