It's related to the Boltzmann distribution being an exponential. But there are all kinds of effects that make a planet's atmosphere deviate from an ideal gas at rest in a homogeneous container.
Gravity changes little over that distance - it's more because of the compounding effect of atmospheric pressure (the deeper you go, the more air you have above you which raises the pressure, raising the density and meaning that pressure increases exponentially faster).
Starting at an initial density of air, suppose you descend a distance D such that the air density doubles. Now your air is twice as dense, which doubles the pressure underneath it, meaning if you descend a further D the density will double again. Continue ad infinitum (or at least until the ideal gas law stops being a good approximation).
> Pressure (P), mass (m), and acceleration due to gravity (g) are related by P = F/A = (m*g)/A, where A is the surface area. Atmospheric pressure is thus proportional to the weight per unit area of the atmospheric mass above that location.