Look at a map. The Persian Gulf is a dead end, and all ocean water flow has to come through the Strait of Hormuz. There's some fresh water coming in from the Tigris and Euphrates rivers, but less each year as that fresh water is captured and used, and as global warming increases evaporation.
The San Francisco bay has to be actively managed for similar reasons. It's a large body of water with a narrow outlet, fed by a river system from which much water is captured. If too little water comes in from the Sacramento River, the delta will turn to salt water. Managing that is what the Bay Model, mentioned recently, is for.