Making an electric motor powered by batteries or batteries is not as easy as it sounds, as it is not enough just to place fixed permanent magnets and a coil where electric current circulates that can rotate between the poles of these magnets. A continuous current such as that provided by batteries is very good for making electromagnets with immutable poles, but for the operation of the motor periodic polarity changes are necessary, something has to be caused to reverse the direction of the current at the appropriate times . In most DC electric motors, the rotor is an ‘electromagnet’ that rotates between the poles of stationary permanent magnets.

https://www.mrosupply.com/bearings/spherical-roller-bearings/322745_23024-ccc3w33_skf-bearing/

To make this electromagnet more competent the rotor contains an iron core, which becomes strongly magnetized as the current slides through the coil. The rotor will rotate as long as this current reverses its direction of travel each time its poles join the opposing poles of the stator. The most common way to achieve these reversals is to use a switch. In its simplest form, a commutator has two copper plates bent and secured in isolation on the rotor shaft and in these plates the ends of the coil winding are welded.