To understand fog, one should understand the basic qualities of the air. The air is a mixture of several gases. In nature, the air always contains some amount of water. As the quantity of water in the air increases, the amount of other gases is decreased proportionally. The air temperature is a major factor in the air's ability to hold water vapor.
Warm air can hold more water vapor than cold air.
When the air can no longer hold the water vapor, it is said to be saturated. Relative humidity is expressed as a percentage. There are two ways to bring air to saturation, one is by adding water vapor and the other is by cooling it. As the actual air temperature drops to the dew point, the air becomes saturated and either a cloud or fog will form. The difference between the actual air temperature and the dew point is called the Temperature - Dew Point Spread.