Convection is the transfer of heat by movement of a fluid such as air. Convection happens in the atmosphere when air near the Earth's surface is heated. This heating causes the air to expand, become less dense than the surrounding air, and rise. The heated air is buoyant and transports heat energy upward.
As an air parcel rises, it cools and expands until it becomes saturated with water vapor. At this point, the water vapor in the air parcel condenses to form cloud droplets. Condensation releases the heat energy (latent heat) stored in the water vapor, increasing the buoyancy of the air. The air parcel will continue to rise until it cools to the point that it is colder than the surrounding environment. Convection can form large clouds and thunderstorms, if there is enough initial heat and water vapor to allow the air parcels near the Earth's surface to rise all the way to the tropopause.