Air molecules in the atmosphere experience the vertically downward force due to gravity just like an apple falling from a tree. Due to thermal motion, air molecules move randomly, their velocity is not in the vertical direction. The downward force gravity causes the density of air in the atmosphere close to earth higher than the density as we go up. But in apple’s case, only vertical motion dominates because of heavier molecules than air molecules.