Sanitary sewers and storm sewers are separate underground sewer systems. They are never connected, and serve different purposes.
Rainwater flows into curbside catch basins and then into the city’s storm sewer pipes. Your roof gutter collects and then directs rainwater into the downspout, which may drain into a storm sewer pipe on your property, and then to the city’s storm sewer pipe. Your backyard may have an area drain, connected to the city’s storm sewer pipe, especially if you live at the bottom of a hill – ground water under your home must be directed to the storm drain. Once in the city’s storm sewer pipe, all the water flows - untreated - to rivers, creeks and into the San Francisco Bay. That's as it should be: rain and ground water returns to the local waterways.
Your sanitary sewer is a collection system for all the water used in the plumbing fixtures in your house, including floor drains as well as tubs, sinks, and washers. Your sanitary sewer pipe directs the sewage from the house to the city's sanitary sewer main and then to the municipal treatment plant for processing. The treated water is then safe to be discharged back into the local water environment in the East Bay.