Land heats more quickly than the ocean water that is much colder than the land in the San Francisco Bay area. When there’s a cool body of water and plenty of moisture to work with, the air forms tiny water droplets and forms extensive cloud cover over the body water.
Meantime, when the mornings are clear and the land heats up much faster than the neighboring body of water you get rising air rapidly and when this happens another air mass will fill in it’s place, so therefore the clouds over the Pacific Ocean will gladly move-in the Bay area causing this amazing view.
The more disparity in readings between the land and water you’ll see a more denser layer of fog that doesn’t dissipate as quickly. This is why you see more fog in the summer and early fall in northern California.