The warmer air expands, becoming less dense than the surrounding air mass, and creating a thermal low. The mass of lighter air rises, and as it does, it cools due to its expansion at lower high-altitude pressures. It stops rising when it has cooled to the same temperature as the surrounding air.