On the end of the valve is the cam follower that doubles as a small piston. This runs in a cylinder mounted on the cylinder head. Air is trapped in the cylinder and as the cam opens the valve, the air is compressed. When the valve is released, the air in the cylinder acts like a spring expanding to close the valve again. In the real world, a full cylinder of air at atmospheric pressure does not have enough force to close the valve again so the cylinders are pressurised to around 100psi. Obviously no seal is perfect and the teams expect some leakage so the cars carry a reservoir of nitrogen compressed to more 2500psi. This is regulated and fed to each of the valve spring cylinders via a ring main and keeps them all topped up to the required pressure. Nitrogen is used because of its stability, however, with the changing temperatures of an engine, pressures would also vary wildly. To combat this each cylinder also has its own bleed valve to release excess pressures. This has the added advantage of bleeding off any oil that collects in the cylinders.