At the heart of a solenoid valve lies a solenoid, a coil of wire that acts as an electromagnet. The coil generates a magnetic field when an electric current passes through it. This magnetic field, in turn, exerts a force on a ferrous metal object, typically a plunger or armature, housed within the solenoid.