The electric motor runs on the principle of magnetic effects that currents have. In this, an external circuit provides a current through a coil, which is placed in between two poles of a magnet. This is where the magnetic fields of both the external pair of magnets and current interact to produce a magnetic force that is mutually perpendicular to current and magnetic field directions. This ultimately causes the coil to rotate and provide mechanical effects.
Now, this is where the function of the commutator - or the “split ring” - comes into play! The force that the coil experiences is maximum when the coil is exactly horizontal (or “flat”), and decreases to zero when the coil is entirely vertical. Due to inertia, the coil keeps on rotating forwards, and the split ring then helps the coil stay untangled, while simultaneously flipping the currents flowing through each arm CD and AB. That way, the current flows uninterrupted, while also making sure the coil doesn’t “flip flop”.