A Stepper motor has a stator and a rotor. The rotor has a permanent magnet attached to it. The stator is made up of coils as shown in the above image.
There are eight coils in this motor. Every coil in the motor behaves as an electromagnet, when they are energized by electrical pulses.