There are a number of factors that play a significant role in determining weather, including air pressure, density and temperature. The density in simplest terms is a measure of number of air molecules in a given area. Higher the number of molecules, denser the air is. The sun rays heat up earth surface, which results in air (near the surface) getting warmer. Warm air rises up and cold air from the higher atmosphere replace it. These currents cause changes in air density, resulting in winds (which flow from denser to rarer regions) and we end up with regions of high and low pressures. One example of a weather pattern caused by such density differences is hurricane. These are regions of low pressure, with high winds and heavy rainfall.
Air density is also related to the temperature, higher the temperature, less dense the air is (molecules have more energy to move at higher temperatures). When moist winds travel up a mountain, they are less dense (warm air) and are forced to drop the moisture level (by precipitation), while coming down on the other side, they become colder and denser, but devoid of moisture. And hence the names, windward and leeward sides.
Hope this helps.