Rain occurs because of moisture gathering higher in the atmosphere. The process that creates rain in the atmosphere has a variety of steps we don't see. This process is called the water cycle. This cycle is never ending, meaning that rain is a constant on the earth as long as there's an ocean or water on the earth.
Water vapor is an atmospheric moisture that is sometimes visible to the naked eye. Water vapor comes in the form of clouds, fog, mist, and dew. The process that creates water vapor is called evaporation, which is where water on the earth is heated to a temperature that makes water molecules spread out and begin to vibrate quicker. This creates water vapor.
The water vapor is commonly carried high into the atmosphere to create clouds. Once the vapor is in the atmosphere, it begins to lower in temperature. This causes condensation, which means the water vapor is reforming into water droplets.
Precipitation Takes place after this. Precipitation occurs when the water droplets are too heavy to carry in the atmosphere, so they drop back down to the earth. After this takes place, the entire process resets, and happens again.
Hope this helps!