"Gibbs Energy is the useful work that can be extracted from the heat of a reaction or a thermodynamic process." I understand how it predicts the feasibility of a chemical reaction , considering the Entropy statement of the Second Law. But how does it relate with the useful work that can be extracted? (This definition is implicitly used in my textbook in deriving from Nernst Equation, the useful work that can be extracted from an electrochemical cell and I am missing the point why this actually works.) Is there an intuitive explanation? Also if this much of energy is "free", what happens to the energy that is "not free"? Why can't we extract the whole energy that is released?
Also I am interested to know if there is any direct relation between Gibbs Function and Kelvin-Planck Statement, which apparently expresses the inherent inability to convert the whole heat to useful work, or am I mixing up two very different aspects? Thanks.