Final answer:
The interaction between electric current and magnetic fields within a motor causes loops of wire to rotate, converting electrical energy to mechanical energy. This is facilitated by components like commutators and brushes that maintain continual torque.
Step-by-step explanation:
The relationship between magnets and electricity is fundamental in how a motor operates. Electric motors are devices that convert electrical energy into mechanical energy. This is achieved through the interaction of magnetic fields and electric currents within the motor. When an electrical current is passed through loops of wire within the motor, these loops become magnetized. The magnetic field around the loops exerts a torque on them, causing the loops, and thereby an attached shaft, to rotate.
Motors contain components such as commutators and brushes to ensure that the current within the loops is reversed at the correct times. This maintains the rotational motion by providing continual torque. As the loops of the motor spin due to the exerted torque, they also act as generators due to the changing magnetic flux, which is in line with Faraday's law of induction. This dual nature of motor operation underlines the close relationship between magnets and electricity in a motor's function.