Why is it possible to use free energy functions on Boltzmann factor?

When the Boltzmann factor is derived on the canonical ensemble, one gets the exponential function of the energy:

$\large{e^{-\frac{E}{k_b T}}}$

However, some texts (it is very common on physical-chemistry, for exemple) just assume that you may use Gibbs free energy on the factor instead:

$\large{e^{-\frac{G}{k_b T}}}$

But what is the justification for this?

I am new to this, so if I am missing something obvious, my apologies. Also, I have not dealt with TD from the chemical or biology perspective.

Assume a given energy, $e^{-E/k_BT}$, provides the relative probability of a particular microstate. Now assume that we are concerned with a isobaric system, so E goes to H, (the enthalapy) and use the equation $e^{-H/k_BT}$.

For the canonical ensemble, we need to take account, at a given energy, of the different microstates that will be present.

$S = k_B ln \Omega$ therefore $\Omega = e^{S/k_B}$

So multiplying these together , to determine the probability that the system, at a fixed energy, is in a particular state:

$$\Omega \cdot e^{-H/{k_B}T} = e^{S/k_B} \cdot e^{-H/k_BT} = e^{TS/{k_B}T} \cdot e^{-H/k_BT} = e^{-(H-TS)/{k_B}T} = e^{-G/{k_B}T}$$

So the overall probability is actually proportional to $e^{-G/{k_B}T}$

So the Gibbs free energy takes into account both energy (in the Boltzmann factor) and entropy, the number of possible arrangments. (by virtue of $\Omega$)