>>64231725
The key trick is how the pneumatic valve works. It's simple and ingenious. The valve has a little mushroom-shaped piece inside it, the "cap" of the mushroom is too big to fit through the opening of the valve, and it is sealed with a leather washer like the other anon explains. The result is that the pressure inside the tank also acts to hold the valve shut. The higher the pressure inside the more force there is compressing the washer to seal it. It's basically the same idea as a schrader valve or poppet-type check valve.
picrel is a simplification of how the tank works. the grey thing is the valve, the brown part is the leather washer. Normally the internal pressure in the tank holds the valve shut. When the gun fires the action strikes the valve stem rearward, this overcomes the internal air pressure and allows a little air to come out of the tank which fires the shot and then closes the valve again, like if you let a little air out of a tire by pressing on the valve stem.
Modern air guns still use that system, though they also have a regulator so the pressure is consistent from shot to shot. A problem with older unregulated air guns like the Girandoni is that every shot is a little weaker than the previous one.