Clouds form when water vapor rises into the atmosphere and condenses onto microscopic particles, such as dust, dirt and sea salt.
When the sun heats water in the oceans, rivers, lakes and other sources, some of it evaporates, or transforms from liquid water to water vapor. With enough heat, water in soils and sediments also evaporates. Additionally, plants transpire, or "sweat out," water vapor from their leaves and stems (similar to way people release water vapor when exhaling).
Some of this water vapor makes its way into the atmosphere through a process called convection, in which hotter, less-dense parcels of air rise, while cooler, denser parcels sink.
Because atmospheric pressure decreases as altitude increases, the water vapor experiences less pressure the higher it rises. With less pressure, the water vapor expands. As it does so, it loses energy, causing it to cool.
Eventually the air reaches the dew point temperature — the temperature at which the air becomes saturated with water vapor. Below this temperature, some of the water vapor begins to condense, or transform from a gas to a liquid.
However, water typically only undergoes condensation when it's in contact with a solid surface; this is where the microscopic particles of dust or salt in the atmosphere (also called cloud condensation nuclei, or cloud seeds) come into play. When enough of the water vapor condenses on the cloud seeds, a visible cloud forms.
But the atmosphere is in a constant state of flux, so both condensation and evaporation occur continuously, even after a cloud forms. If there's more evaporation from the cloud than condensation into it, the cloud will dissipate; if there's more condensation than evaporation, the cloud will grow.
Precipitation occurs when the water droplets in the cloud become too heavy to remain aloft on the atmosphere's air currents.