How does precipation occur snd what determines the type of precipitation that falls on earth?

Precipitation occurs when a front collides with moist air particles. It raises those particles into the air and condenses them into clouds if those clouds become big enough and the water droplets become heavy enough they come down as rain if the air is warm enough for rain. If the air drops to 34 degrees and below then it could become snow or freezing rain. The air temperature is what determines what type of precipitation occurs.