In a sense, you are right. Burning things doesn't generate energy, it releases energy that has been stored in chemical bonds. Consider fossil fuels: given plenty of oxygen and sufficient energy for activation, the carbon-carbon and carbon-hydrogen bonds in hydrocarbons all break down, and carbon-oxygen and hydrogen-oxygen bonds are formed, giving an overall process where the hydrocarbon reacts with oxygen to give carbon dioxide, water, and energy.
The energy was originally provided by the sun. Plants are factories which convert carbon dioxide, water, and energy derived from sunlight, into a wide variety of biological molecules and oxygen. These biological molecules are further modified by energy from geological processes after the plant has died. Millenia of pressure and temperature from those processes gradually convert the biomass into oil, coal, and gas.
All we are doing is digging up the products and burning them to release the energy that has been stored in them.