The natural gas is composed of methane, butane, propane and a small amount of iso-Butane.
These all are organic compound (alkanes) and burn in presence of the oxygen to give carbon dioxide. The burning of the alkanes is type of exothermic reaction, which means they liberate heat energy on reaction. The enrgy is released due to the braking of the bond and the formation of the new bonds.
Hence, it can be concluded the chemical taking place at the time of burning of these gases gives off the energy.