There are CO2 scrubbers on board, the crew turns them on/off to control concentrations. It's one of the things I checked before I went on every watch as OOD (officer of the deck): the CO2/O2 concentrations. (One of our weapons officers was really sensitive to CO2 concentrations and would s*t all over any OOD who let them get too high.)