The higher you go up, the colder it gets - this is known as the lapse rate - it gets about 3.5 degrees cooler each 1000 feet you go up. At very high altitudes, it is always freezing, so snow and ice accumulate.
2. Orographic effects and the rain shadow
Mountains are a major obstacle to the horizontal movement of air we call wind. Mountains often experience more precipitation because air being blown across a mountain is forced up to a higher altitude. As the air cools, the water vapor often condenses into clouds and may fall as rain or snow. The upwind or windward side gets the most precipitation. After the air reaches the summit, it begins to descend and warm up. That is why the leeward, or downwind side is warmer and drier - a place called a rainshadow.
Climate in the Andes
The rain shadow effect - Map of rain gauge locations - Orographic Uplift and Rainshadow