An electric motor receives electric energy in the form of an electric current and produces a movement (mechanical energy). In other words, it is the opposite of a generator.
The magnetic field of the magnet generates a force on the conducting wire through which the current is circulating, and that force makes the loop move. The following visual explains how an electric motor works. Carry out the activity suggested.