A lot of amazing research and startups come out of UC Berkeley, and while they are on the fringe of the Bay Area and arguably outside of it UC Santa Cruz and UC Davis do very interesting research in bio chemistry and materials
My opinion is that there are 3 main drivers and that top tier education is one of the most important ones.
They go like this:
Higher education that has enough gravity to aggregates diverse 'cutting edge' people from a variety of pursuits.
A reason for those smart people to stay that isn't just money. I think that's lifestyle and access to nature. You have the ocean, mountains, wine country, and relatively good weather.
The last is capital, I think saying companies is putting the cart before the horse. When I say capital I don't just mean startup capital. The ecosystem has to also have liquidity. There are lots of areas that have one of the 3, but very few that have all of them.