I'll augment the other answer with an example. Consider a theoretical north-south oriented mountain range that rises 2000 m above sea level and the land on either side of the range is at sea level. A little ways west of the mountain is ocean. The location is the mid-latitudes and the prevailing wind is from the west.
Air along the surface travels above water, picking up moisture. Lets assume a surface temperature of 28 °C and a dewpoint of 23 °C once the air reaches the base of the mountain on the west side. This parcel now rises the 2000 m vertical height of the mountain. At around 500 m the parcel has cooled to saturation and now has a temperature of 22 °C and a dew point of 22 °C. This height will also be the altitude where clouds form. At and above 500 m the mountain will be cloudy. The parcel will continue to rise another 1500 m to the top of the mountain at 2000 m where its temperature has now cooled to about 16.5 °C.
As the temperature dropped from 22 °C to 16.5 °C water condensed to contribute to cloud water and rain. In total, for every kg of air flowing up the mountain in this state, 3 g of liquid water is produced via condensation. This windward side of the mountain with the moist upslope flow is going to be lush from frequent and abundant rain showers.
Once the parcel tops the mountain and begins to flow down the lee slope it will begin to warm and relative humidity will drop. Any cloud blown over the mountain top will evaporate as it moves downslope. By the time the parcel reaches the ground at sea level east of the mountain it has a temperature of 36 C and a dewpoint of 19.5 °C - hot and dry. The less slope and the region to the east will be arid. Regions like this are referred to as being in the "rain shadow" of a mountain.
These numbers are ballpark back-of-the-envelope estimates from a Skew-T diagram and while not exact they are representative.