Image Courtesy of CMMAP
Some clouds form due to the heating of the Earth’s surface. First, the Sun heats the ground, which then heats the air. This warm air is lighter and less dense than the surrounding air, so it begins to rise. When this air rises, it expands because of the lower pressures that exists at higher levels in the atmosphere. Anytime air expands because of a drop in pressure, it also gets cooler. So when the rising air expands it also cools.
The cooling air that is rising is no longer able to hold all of the water vapor it was able to hold when it was warm. This extra water vapor begins to condense out of the air parcel in the form of liquid water droplets. As the air parcel rises higher and higher, it continues to expand and get cooler, and more moisture condenses out of it.
Eventually, enough moisture will condense out of the air parcel to form a cloud! The types of clouds that form from the process of surface heating are cumulonimbus (and associated mammatus clouds), cumulus, and stratocumulus.
In contrast to surface heating, the cooling of the Earth’s surface leads to the development of fog and stratus clouds.
source: windows to the universe