The atmosphere is actually a fluid . If not mixed, fluids of different densities will arrange themselves into layers due to gravity. Much of Earth's atmosphere is well mixed by the winds, so that different gases are not generally separated by density. Warm air and cool air do separate, however, because warm air is less dense than cold air and warm air therefore rises. Add ice to a large container and observe that cooler air remains on the bottom while warmer air rises to the top.
Air pressure plays a major role in determining weather patterns.
Generally, the weather is good when the pressure is high and the weather can be threatening when the pressure is low. Winds generally blow from areas of high pressure to areas of low pressure. The air is forced to rise when it reaches the low pressure areas. As the rising air expands and cools, water condenses out of the atmosphere. When this happens, cloudy or wet weather results.