The rotor, also called an armature, is the part that rotates. The shaft is supported by bearings on either side of the casing. Many small stepper motors have magnets glued all the way around the armature. When the armature is placed inside the field windings, it rotates when each field winding is turned on.
When an electric current is passed through a coil of wire, it turns into a magnet. When the electricity is removed, it stops being a magnet. Field windings use this principle, and are nothing more than electromagnets. Field windings surround the armature. When a pulse of electricity is applied to one, it becomes a magnet and attracts the magnet in the armature causing it to turn. When the electricity is turned off, it stops attracting the magnet in the armature. Many stepper motors have one, two, or multiples of two small field windings. Electricity is pulsed through the windings by the controller, which times the pulses.
The controller is what feeds the electricity to the field windings (see reference 1, page 10). Wires are attached to each winding and to the controller. Small electrical pulses are applied to each winding, with each pulse slightly time lagging behind the one before it. Think of pulse timing in this way: Suppose you are the controller of a motor with four field windings. You apply electricity to one winding and remove it. The armature will spin to the first winding. You apply electricity to the second winding, then remove it. You do the same for all the windings, going around in a circle. If you can do this very fast, the motor will spin. A controller does exactly that. By time lagging the pulses to each windings, the armature will spin.
While programming is not a hardware component, it is also a very important component. All the mechanical and electronic components will not work unless the controller is programmed properly. Complex programs are written, to tell the controller how to time the electrical pulses to the field windings. For example, one line of the program may instruct the controller to send out 50 electrical pulses to the windings in one second. A common household printer uses stepper motors, to control the carriage movement and the paper feed. The reason the resolution is very fine in printers is that each pulse may last only a microsecond, moving the carriage maybe only a thousandths of an inch.