As a person breathes, the body consumes oxygen and produces carbon dioxide.
By adding sufficient oxygen to compensate for the metabolic usage, removing the carbon dioxide, and rebreathing the gas, most of the volume is conserved.