Fog is caused by changes in temperature and air pressure.
If you were to take a glass and fill it with ice, you would see water form on the outside of the glass because of the difference in temperature. That's called condensation. That's why you usually see fog in the morning over lakes. The water in the lake doesn't cool as quickly over night as the air above it. That change in temperature causes tiny beads of water to form around ever smaller particles of dust which are floating around in the air.