When the earth is warmed via the sun, the layer of air nearest to the surface of the earth becomes warmer. The heating of the air will not be uniform, so there will be some lumps of air that become warmer, hence less dense and more buoyant than other air bubbles . The buoyant bubbles will rise. As the air rises is becomes saturated and the water vapour begins to condense and hence clouds are formed. Air flowing up slopes.
Air is cooled adiabatically as it rises up the slopes of hills and mountains.
If the air rises enough when the hills or mountains are sufficiently high or when the air is sufficiently moist, cloud will be formed. Air being forced to rise in the vicinity of cold or warm fronts. Warm air is forced to rise over a mass of heavier cold air. As the warm air rises it cools, and then clouds may be formed. The forced ascent of air, which results from the convergence of high and low pressured air.