Water evaporating from a surface causes fog. Usually, this evaporation is from a body of water, such as a lake, river or the ocean, or it can be caused by water evaporating from moist ground in a yard or field.
Water vapor is added to the air by the wind, by daytime heating and via precipitation. It can also come from plant transpiration, which is the reason that fog is often seen rising over a mountaintop. For fog to develop, the relative humidity needs to be near to 100 percent, and the dew point temperature and air temperature must be close to each other by around 4 degrees Fahrenheit.