Brushed DC motors were invented in the 19th century and are common. Brushless DC motors were made possible by the development of solid state electronics in the 1960s.
An electric motor develops torque by alternating the polarity of rotating magnets attached to the rotor, the rotating part of the machine, and stationary magnets on the stator which surrounds the rotor. One or both sets of magnets are electromagnets, made of a coil of wire wound around an iron core. DC running through the wire winding creates the magnetic field, providing the power which runs the motor. However, each time the rotor rotates by 180° (a half-turn), the position of the north and south poles on the rotor are reversed. If the magnetic field of the poles remained the same, this would cause a reversal of the torque on the rotor each half-turn, and so the average torque would be zero and the rotor would not turn. Therefore, in a DC motor, in order to create torque in one direction, the direction of electric current through the windings must be reversed with every 180° turn of the rotor (or turned off during the time that it is in the wrong direction). This reverses the direction of the magnetic field as the rotor turns, so the torque on the rotor is always in the same direction.