The article How Electric Motors Work explains how brushed motors work in great detail. In a typical DC motor, there are permanent magnets on the outside and a spinning armature on the inside. The permanent magnets are stationary, so they are called the stator. The armature rotates, so it is called the rotor.
The armature contains an electromagnet. When you run electricity into this electromagnet, it creates a magnetic field in the armature that attracts and repels the magnets in the stator. So the armature spins through 180 degrees.
To keep it spinning, you have to change the poles of the electromagnet. The brushes handle this change in polarity. They make contact with two spinning electrodes attached to the armature and flip the magnetic polarity of the electromagnet as it spins.
This setup works and is simple and cheap to manufacture, but it has a lot of problems:
- The brushes eventually wear out.
- Because the brushes are making/breaking connections, you get sparking and electrical noise
- The brushes limit the maximum speed of the motor.
- Having the electromagnet in the center of the motor makes it harder to cool.
- The use of brushes puts a limit on how many poles the armature can have.