The rain shadow effect occurs as warm, moist air rises against high elevations of land and drops its water along the way. This creates a region on the far side of the mountain range that is relatively deficient in precipitation to the point of forming a rain-shadow desert.
The air over large bodies of water tends to be dense, warm and moist. Saturated air moves easily along the surface of the water, as there are very few obstacles to its passage. On reaching land, moisture-laden air can sometimes travel hundreds, or even thousands, of miles across relatively flat country, depositing its moisture as it goes.
In places where the coastal elevation rises steeply, however, it is not possible for the ocean air to pass over the land without rising above the level of the mountains. As it does so, the air expands and becomes less dense. Expanding gases tend to cool, so the temperature of the air mass drops sharply with rising altitude. Cold, rarefied air is very poor at retaining water vapor, so the water in the air tends to precipitate out along the windward slope of the mountains. By the time the air rises high enough to cross the mountains, it has shed most or all of its water and cannot irrigate the leeward slope or the rain shadow area inland of the chain.