The core mechanism
Every solenoid valve is an electromagnet wrapped around a sealed stainless core tube containing a spring-loaded plunger. In a normally closed valve the spring presses the plunger, tipped with an elastomer or PTFE insert, onto the orifice. Energising the coil creates magnetic flux that pulls the plunger up the core tube against the spring, lifting the seal off the orifice and opening the path. De-energise, and the spring plus line pressure reseats it. A normally open valve inverts the linkage so that coil force closes the seat instead. There is no gland or dynamic external seal; the media is contained by the core tube, which is why solenoid valves are inherently tight to atmosphere.
