Consider an air parcel at rest. There are three forces in balance, the downward pressure force, which is pressure times area in the parcel's top, and an upward pressure force on the parcel's bottom, and the downward force of gravity actually on the parcel's mass, which is just the acceleration due to gravity times the parcel's density times it's volume.

The volume equals the parcel's cross sectional area times its height. We can sum these three forces together and set them equal to 0 since the parcel's at rest. Notice how the cross sectional area can be divided out.

The next step is to put the pressure difference on the left hand side. And then shrink the air parcel height to be infinitesimally small, which makes the pressure difference infinitesimally small. By dividing both sides by the infinitesimally small height, we end up with an equation that's the derivative of the pressure with respect to height, which is equal to minus the parcel's density times gravity. This equation is the hydrostatic equation, which describes a change of atmospheric pressure with height.