Any chemical reaction is just the exchange of electrons, often creating and breaking bonds, changing the properties of the reactants into something different, and usually more stable, which is called the product. Whenever you combust a hydrocarbon, for example methane (CH4) are setting up a chemical reaction that reacts oxygen with your hydrocarbon (in this case Methane) you get the products carbon-dioxide (CO2) and water (H2O). The balances equation looks like this.
CH4 + 2 O2 → CO2 + 2 H2O
But this is only the combustion of a hydrocarbon. You are wondering about Hydrogen. That is a much easier equation
2 H2 + O2 → 2 H2O
(H2 because hydrogen is a diatomic gas)
So as you can see, water is just hydrogen that has reacted with oxygen to be in a more stable state.