I have recently looked into two different derivations of the Barometric formula, trying to figure out why both of them work: (assuming temperature is constant for all heights)
One is based on the hydrostatic principle $\frac{\mathrm{d}p}{\mathrm{d}h}=-\rho(h)g$, i.e. the pressure of the gas is given by the weight of the gas above. Solving this differential equation, one ends up with an exponential dependence, and using the ideal gas law, one arrives at the Barometric formula. A bit more explicit: We know that the pressure is given by the pressure of all the air above us, or put differently, the pressure increase per height is given by the additional weight of air at that height: $$\frac{\mathrm{d}p}{\mathrm{d}h}=-\rho(h)g$$
Inserting the ideal gas law $\frac NV=\frac p{k_{\mathrm{B}}T}$ and $\rho=\frac{Nm}V$ (where $m$ is the mass of air particles) we get
$$\frac{\mathrm{d}p}{\mathrm{d}h}=-\frac{N(h)mg}V=-\frac{p(h)mg}{k_{\mathrm{B}}T}$$
Solving for $\rho(h)$ we get $$p(h)=p_0\exp\left(-\frac {mg}{k_{\mathrm{B}}T}h\right)$$
The second derivation is based on statistical mechanics: We know that the number density of molecules follows Maxwell-Boltzmann Statistics, i.e. $n\propto\exp\left(\frac{mgh}{k_{\mathrm{B}}T}\right)$. Using the ideal gas law and the fact that temperature is constant, we can see that the pressure is once again following an exponential. A bit more explicit: We expect the distribution of particles into the different energy states to follow Maxwell-Botzmann Statistics, i.e. $N(E)\propto\exp\left(-\frac E{k_{\mathrm{B}}T}\right)$ (assuming no/constant degeneracy). The energy of the different states in our case is given by the potential energy of the particles: $E_{\mathrm{pot}}=mgh$. Thus
$$N(h)\propto\exp\left(-\frac{mg}{k_{\mathrm{B}}T}h\right)$$
Using the ideal gas law $N=\frac{pV}{k_{\mathrm{B}}T}$ we finally get
$$\frac{p(h)V}{k_{\mathrm{B}}T}\propto\exp\left(-\frac{mg}{k_{\mathrm{B}}T}h\right)$$ $$\Rightarrow p(h)=p_0\exp\left(-\frac{mg}{k_{\mathrm{B}}T}h\right)$$
The issue is now that I don't see the connection between the two: Both approaches seem to work fine and are frequently used to derive the Barometric formula. However, the first one looks at all the gas "pressing down" on a given volume, whereas the second one does not assume any interaction between the individual air particles.
What I've been able to see so far is only that we implicitly use Maxwell-Boltzmann statistics in the first derivation via the ideal gas law, but the use of the hydrostatic principle seems to have no analogue in the second derivation. As such, this is the part I'm most suspicious about: What assumptions do I have to make to apply the formula for hydrostatic pressure (All derivations I could find so far seem rather hand-wavy, so I'm not sure on the specifics here)? Can I apply it to an ideal gas?
TL;DR
To summarize: What are the analogous parts of the two derivations of the Barometric formula above? Why do both work? Where do I invoke the equivalent of hydrostatic pressure in the second one? Is the issue somewhere else, maybe in the assumption of constant temperature?