San Francisco is atop the San Andreas Fault, a major earthquake line. After the 1906 earthquake, California has implemented building codes that are designed to withstand earthquakes. You can learn more about this at the Association of Bay Area Goverments (ABAG) at abag.ca.gov/bayarea/eqmaps.
The hazard map is based on the underlying geology. Risk levels may be incorrect by one level higher or lower. From "On Shaky Ground" (ABAG, 1995.) For updated maps, visit abag.ca.gov