A current turns a conductor into an electromagnet. ... When the electromagnet is placed near a fixed magnet, the two sets of poles repel and attract each other. This produces a force that makes the conductor rotate (spin) at high speed. This turns a shaft, which then drives a machine.