Fog forms when the air near the ground cools and reaches its dew point, causing water vapor to condense into tiny water droplets that hang in the air.