How and why does the pressure change in the upper air?
Imagine the atmosphere consisting of an infinite number of slices in the vertical. As heat is pumped into each slice, by whatever method (advection from somewhere else; heating from below etc.), that slice expands (gains energy), and as well as expansion sideways, and downwards (against a net expansion upwards by the layer below), there is a general expansion upwards. The definition of atmospheric pressure is the force per unit area due to the weight of the atmosphere above any defined point. Thus, for any level in the atmosphere, if heat is supplied to a column of these infinite number of slices, the whole column expands effectively upwards, and because more of the atmosphere is now above any one point, the pressure at that point increases.(There must be a net expansion upwards, because the earth’s surface forms an effective block to net downward expansion.) The opposite occurs for cooling of a column.