A lot of long time and native Bay Area residents have favorable housing situations, either by owning a family home from before the latest bubble, or by living in a rent controlled apartment or an apartment with a landlord who prefers tenant stability over chasing market rents.
Same situation in NYC, but there are many more people like this. The great majority of police, teachers, and other city workers in NYC are natives with homes bought in more affordable times, because nobody else could afford to live here on with such a low paid job.
The house I share was bought for $30,000 in the early 1980s, paid for by a single uneducated emigrient worker.