Fog is one of that large number of words whose origins are obscure.
Its first use had nothing to do with mist or water, but was the name given to the new grass which grows up in a field after it has been cut for hay, or the long grass which is left standing in the field over winter. In Scotland and the north, it could also mean moss, and hence a marsh or bog. The next step was to create the adjective foggy for places overgrown with long grass, or a place that was marshy or boggy. Somehow, we don't know exactly how, that word was also taken to mean the state of being thick or murky, as of the mist or vapours that arose from such places. Perhaps it was a reference to the heavy dew of a morning on long grass, which from a distance can look like a layer of mist.