An electric motor is a device that uses electromagnetism to work. When a current flows through a conductor, a magnetic field forms around it. If you supply another magnetic field the two will interact with force, which yields torque that can spin things.
Electric motors can be dissected into two large parts, rotor and stator. The easiest of all motors to understand is a synchronous motor. The stator is powered using a three-phase voltage, which causes current to flow and ultimetely produces a rotating magnetic field, also known as RMF. On the rotor there are permanent magnets that get pulled by the field as another magnet would pull a magnet to itself and the rotor starts spinning. Thank tesla for that one
