ELI5: Explain Like I'm 5

how an electric motor works?

An electric motor is a machine that runs on electricity and uses magnets to make it spin. Inside the motor there are two sets of magnets. One set of magnets is fixed in place and the other set turns around. When electricity flows through the wire coil inside the motor, a force is created between the two sets of magnets which makes them turn. As one set of magnets spins, it creates a spinning motion that can then be used to power machines.