An electric motor converts electrical energy into mechanical energy through electromagnetic principles. Current flowing through coils in a magnetic field creates torque, producing rotational motion. This is opposite to a generator, which converts mechanical energy into electrical energy.