That's literally the same as asking "how come hydrogen (flammable) + oxygen (enhances fire) = water (does not burn)?", but we probably have a better mental grasp of how water works.
Water is kind of like ash. Technically full combustion of any hydrocarbon outputs CO2 and Water. Since water isn’t a greenhouse gas it’s not mentioned when discussing combustion usually.
This is one of the reasons why methane leaks are so impactful - not only is methane a terrible green house gas, when it decays in the upper atmosphere, it decays into water vapour and CO2)
https://science.nasa.gov/earth/climate-change/steamy-relatio...