Bonds are stable configurations of (relative) minimal energy. So when entering a bond the combined energy level of the contributing atoms is being reduced to a local minimum. That way “free energy” is released that shows as heat or radiation (e.g.) in the environment.