The free energy is defined, for a physical system is
=Expected value of Energy - Temperature Entropy
It captures the "amount of energy that can be usefully extracted from a system", roughly.
The Second law of thermodynamics implies that non-equilibrium physical systems evolve in a way that decreases free energy (although the notion of free energy that is relevant depends on the constrains imposed on the system). [+ it only stays constant in equilibrium, so out of equilibrium it strictly decreases, although potentially very slowly, a situtation called metastable equilibrium)
See here (and here)for definition and connection with Relative entropy. This immediately implies that the Boltzmann distribution is the unique minimizer of the free energy, which implies it is the equilibrium distribution as per the above free energy minimization principle.