Total chemical energy of the reactants is more than that of the products, resulting in the transfer of this energy difference to the surroundings in the form of heat
Chemical energy of the reactants is less than that of the products, causing the transfer of this energy difference from the surroundings to the chemicals involved
Whether a reaction absorbs or releases energy depends on how much energy it takes to break old bonds compared to how much is released when new bonds form