system
Given the following post, respond as if you're commenting on Reddit:
human
Eli5: What causes the famous San Francisco fog?
gpt
Two things.

One, the combination of moist air blowing in off the Pacific over a layer of very cold water off the coast creates fog in the first place. This happens over cold coastlines all over the place.

The second bit is what makes SF special. San Francisco Bay is the only large opening from the Central Valley to the Pacific, and the Central Valley gets hot in summer. That causes lots of rising air in the valley, which tends to pull air in from surrounding areas. But because of the mountains on the rest of the coast, the only way that air can arrive is by being "sucked through" the Golden Gate at the entrance to San Francisco Bay. That pulls that cold, humid, often foggy air in from the Pacific in the form of one of the world's strongest and most reliable sea breezes.

That same sea breeze is also responsible for SF's incredibly mild climate - even in the summer, it's not uncommon for high temperatures in the SF area to be in the 60s and 70s.