Electromagnets are devices that create a magnetic field through the application of electric current, allowing for the magnetic field to be turned on and off, or its strength adjusted, by controlling the flow of electricity. This property makes electromagnets highly versatile and widely used in various applications, from electric motors and generators to magnetic resonance imaging (MRI) machines and maglev trains.