Here's how it works:
1. Moist air mass: Air carrying moisture moves towards a mountain range.
2. Forced uplift: As the air mass encounters the mountain, it is forced to rise.
3. Cooling and condensation: As the air rises, it cools. Cool air can hold less moisture, so the water vapor in the air condenses into clouds.
4. Rainfall: The condensed water vapor falls as precipitation on the windward side of the mountain (the side facing the oncoming air).
This is why the windward side of a mountain range often experiences more rainfall than the leeward side.