When an electric current is applied to a solenoid, it creates a powerful magnetic field that attracts or repels a magnetic material, ie magnetic plunger, to move inside of its housing. As the plunger moves back and forth, it creates the mechanical motion that powers the intended component.