What does it mean that a chemical system is in a state of equilibrium? When we look at the chemical equation, you have reagents on the left and products on the right. At equilibrium, the probability of the system moving a little bit to the right and forming a bit of product equals to the probability of the system moving a little bit to the left and forming a bit of reagent. This is the meaning of the term 'microscopic reversibility'. Small changes from the equilibrium state are reversible, i.e. nonspontaneous.

H = U + PV. That is the enthalpy of the system. If you picture a small change in a system at equilibrium, you are imagining a change in the enthalpy of the system, a bit of heat flows in or out. At equilibrium, these heat flows are reversible.

When we talk about heat flow into or out of a system at equilibrium, what we are describing is a heat flow that does not change the total entropy of the universe. If the reaction goes a bit in the exothermic direction and heat flows out into the environment, the entropy increase in the surroundings is exactly balanced by a decrease in disorder in the system.

If change in the forward or reverse direction would increase the entropy of the universe, either by letting heat flow out into the environment or by increasing disorder in the system, or some combination, in which entropy change due to heat flow is not compensated by entropy change do to the system's order, then the system is not at equilibrium. Free energy is a function of the system derived predict if this is the case, whether or not heat flows are reversible. If there is a free energy difference, whether positive or negative, heat flow is not reversible, and the system is not at equilibrium. Spontaneous changes are occurring. Free energy is available for either the forward or reverse direction. Things will spontaneously change until the reagents and products have equal free energy. Then we are at the equilibrium state.