The rotating armature consists of one or more coils of wire wound around a laminated, magnetically "soft" ferromagnetic core. Current from the brushes flows through the commutator and one winding of the armature, making it a temporary magnet (an electromagnet). The magnetic field produced by the armature interacts with a stationary magnetic field produced by either PMs or another winding a field coil, as part of the motor frame. The force between the two magnetic fields tends to rotate the motor shaft. The commutator switches power to the coils as the rotor turns, keeping the magnetic poles of the rotor from ever fully aligning with the magnetic poles of the stator field, so that the rotor never stops (like a compass needle does), but rather keeps rotating as long as power is applied.
Try to answer this question if possible (otherwise reply "unanswerable"): What element of the motor keeps the poles from alligning?
commutator