Where does energy come from in a chemical reaction?
Energy is released when bonds are formed.
Energy is released when bonds are formed. That may seem counter intuitive but if you observe an activation energy chart you will see that it requires a specific amount of energy to reach the transitional state and to form products.
This is the same for both exothermic and endothermic reactions, the only difference depends on if the product is higher or lower in energy.