How to calculate the volume of oxygen in a reaction between hydrogen peroxide and bleach using this apparatus
This is how it works in my head:

If instead of peroxide in the syringe, you just had $\pu{20cm^{3}}$ of air, then injecting the air will cause a reading of $\pu{20cm^{3}}$ to happen.  The water gets pushed out of the way.

Injecting peroxide would do the same thing (approximately).  After the reaction, there is still saltwater and leftover reactants taking up space.  The oxygen produced will take up additional space (and push the water away) because it is a gas and it wants to expand.