The commutator takes its name from the Latin word commutare = (to change or swap) and is responsible for changing the current direction. It is therefore also often referred to as a current reverser. With the change in current direction, the magnetic field of the electromagnet changes as well. This is necessary in order for the rotor to turn continuously.
With commutation, a distinction is made between mechanical and electronic commutation.