Magnetic forces are fundamental forces that occur due to the movement of an electrical charge, and magnetism is a phenomenon that causes materials to attract or repulse other materials.
When current passes through a conductor, a magnetic field is created around it. When wire is wound into a coil, it produces a much stronger magnetic field. By turning current to the coil on and off, this magnetic effect can be turned into mechanical movement, pulling a switch open or closed. This is the principle behind electrical relays. Coils of wire can be mounted on a shaft and placed in a magnetic field. Sending current through the coils draws them across the field, and if the current is accurately switched, this is constantly repeated to produce the rotary motion of the electric motor.
An electric field, and therefore an electric current, can be induced in a fixed conductor by changing magnetic fields. A current can be induced by moving a conductor in a fixed magnetic field. This electromagnetic behavior is the basis for many electric motors and generators.