I believe the idea is that in a landfill those products will release CO2 and methane, whereas when composting they only release CO2. Methane is a more potent greenhouse gas, so that's another benefit to composting.
https://recycle.com/organics-compost-vs-landfill/#:~:text=La....