Material equilibrium is reached when a system is in chemical equilibrium and in phase equilibrium. Chemical equilibrium implies that all reactions occurring in the system have reached equilibrium. Phase equilibrium implies the absence of a net flow of matter from some phases of the system to others.
The second law of thermodynamics provides us with an equilibrium criterion for isolated systems. In addition, it allows us to determine if a process is possible. The processes that involve an increase in the entropy of the universe $S_{uni}$ are spontaneous and irreversible. Those processes with $\Delta S_{uni}=0$ are reversible and very difficult to perform. Processes involving a decrease in entropy $\Delta S_{uni}<0$ do not take place.
In this section we will see two functions that allow us to predict the spontaneity of a process in a more general way than entropy. These new state functions are: the Helmholtz function $A=U-TS$ and the Gibbs function $G=H-TS$