Anaerobic bacteria produce methane. When oxygen is present, the aerobic pathway outcompetes anaerobic because more energy is available, producing CO2 instead.
GHG are usually measured in tonnes of CO2 equivalent (GWP) where methane is about 80x as much warming as the same mass of CO2 over a 20 year period, or about 25x as much warming over a 100 year period.
This is also what's going on in the steady replacement of various refrigerants with lower-GWP alternatives.
