In general, a solenoid uses electromagnetic force to move a plunger, thereby converting electric energy into mechanical motion. (“Electromagnetic” means it’s only a magnet when electricity is applied.