The barrel extends inward all the way to the diaphragm. Click to get a bigger version. This animation of the diaphragm shows how it works. Gun is loaded, with no pressure. The release valve is shut.
Pressure is pumped in.
The two air chambers equalize, because the pressure leaks around the diaphragm. Pressure stays in. This keeps it sealed. Open the release valve, and the first chamber depressurizes. This sucks the diaphragm away from the barrel, so the air can escape, firing the bullet.