The surface of the ground at night cools down because of outgoing long-wave radiation. In my understanding the cooling of the surface also causes cooling of the adjacent air. If the air contains enough water vapor, dropping of the temperature causes condensation of liquid water droplets and formation of fog.
In my region (Central Europe near 50°N) in winter, stratus clouds can be observed much more often than fog. Typically the base of the stratus cloud is 100 meters or higher above ground surface and the thickness of the stratus is several hundred meters. What puzzles me is the "empty" layer between the ground surface and the cloud base. Why does the stratus cloud often not reach all the way to the ground? What factors determine the stratus cloud base height?