This actuation of electric energy to mechanical energy is due to reverse magnetic induction. When you pass a wire coil, with electricity passing through it, along a magnetic field, the coil will rotate according to Fleming’s Left Hand Hand Rule. This principle is harnessed in the making of motors that can be used to power equipments such as fans.