In order for the fish or anything non autotrophic to produce CO2, they need to burn carbonhydrates/ reduced sugars. To do that, they need O2. So for each O2 they use up, they produce a CO2.
There's only 6-8 ppm in most well run aquariums of O2.
So the more fish you add, the less O2.
The other bad thing with too many fish: more NH4 waste. Good filters, lots of plants can handle a fair amiount, but if you overload the system, the time it takes for the NH4 to be processed increases.............and then you get an algae bloom and the water's O2 goes down moere since now the bacteria start really using up the O2 as well.
If you take a deep gravel sample and add it to a vial and shake it good without any air inthe vial and you do not disturb the gravel sample when you take it, the O2 will quickly drop to zero(bacteria will use it all up rapidly).
You should gravel vac the substrate once every few months in sections(2-4 over 2-4 week's time) to reduce the load of bacteria snd detritus, reduced carbon laying around in a tank.