system
Given the following post, respond as if you're commenting on Reddit:
human
Why don't sealed terrariums explode?

Is it balanced so perfectly that the oxygen released by the plants is utilised by microorganisms that in turn provide carbon dioxide and nitrogen/waste, which feeds the plants and the cycle restarts? I'd just imagine there being some offset that causes gas accumulation eventually causing the glass jar to explode. 

Especially when the animals within, snails and such, piggybacking on the plants I introduce, begin to breed? 

Similarly to when I did sauerkraut that one time and didn't provide a release valve 😅

How can these jars stay sealed for years with no mishap it's amazing!
gpt
In order for the pressure to build up, you need something that is solid or liquid to be converted into a gas. In your sauerkraut case the bacteria doing the fermenting broke down your cabbage (solid/liquid) and released part of it as a gas.

In most ecosystems (the terrarium in this case) things are broken down and turned into gasses, but then other organisms will work in the opposite direction and turn those gasses back into solids. When a plant is doing photosynthesis, it is using power from the sun to take the carbon on CO2 and turn it into glucose (sugar), which is taking gas out of the terrarium and turning it into a solid (sort of). Other organisms will take nitrogen (N2) out of the air and turn it into something usable (often ammonia), which is then released again as big molecules break down. The balance of all of this is very important, and when things get out of flux it can have negative impacts. Sometimes runoff from farms can put too much (solid) nitrogen into an ecosystem and cause algal blooms that kill everything off.

Luckily ecosystems evolve in such a way that things are often kept at sort of a balance. If you have an ecosystem with too much oxygen in the air then organisms that can use that oxygen will flourish and naturally reduce it. So when you make a healthy terrarium you often are getting all of those balancing components. It is possible to create the sauerkraut situation though, if you don't have places for your water to drain and move through you can cause bacteria similar to the ones fermenting your cabbage to build up quickly, and then will create excess pressure, though there is less food available so it might not explode.