Stepper motors are brushless DC motors that divide a full rotation of their shafts into a fixed number of steps. Each electronic pulse sent to a stepper motor makes it move a step. Because of this feature a stepper motor can be used in positioning systems without the need of a feedback mechanism.
Stepper motors effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. The electromagnets are energized by an external driver circuit or a microcontroller. To make the motor shaft turn, first, one electromagnet is given power, which magnetically attracts the gear's teeth. When the gear's teeth are aligned to the first electromagnet, they are slightly offset from the next electromagnet.
This means that when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one. From there the process is repeated. Each of those rotations is called a "step", with an integer number of steps making a full rotation. In that way, the stepper motor can be turned by a precise angle.