The working of an electric motor is based on the assumption that a conductive current generates a magnetic field around it. Consider the following situation,
Take two bar magnets, and leave a small space between the poles facing each other. Now, take a small conductive wire length and make a loop. Keep this connection between the magnets, so that it is still inside the magnet’s area of influence. Now for the final part. Attach loop ends to battery terminals.
As electricity flows through your simple circuit, you will find that your loop moves. The magnet’s magnetic field interferes with that generated by the conductor’s electrical current flow. Because the loop has become a magnet, it will draw one side of it to the magnet’s north pole, and the other to the south pole. That causes the loop to rotate continuously. This is the idea of an electric motor working.