10-12 years ago, there was no tech in SF. Zero. It was mainly financial companies or workers for Levi's, Gap, etc. All the best tech companies were in South Bay. It was Twitter, Zynga, Yelp and quickly followed by Uber, Airbnb, and all the other cool startups that brought tech into SF and probably the cause of that shift. SF started giving tax breaks to tech companies in the late aughts, and then it started the huge migration of tech startups from South Bay to SF.
Before that, it was rare for tech workers to live in SF. Most would live in South Bay and come up to SF to party on weekends.
Also, salaries went crazy in the last 8-10 years. Once all these rich tech workers came to the city that thought they knew best because they were rich and young, that's probably what caused the shift.