Think of it as a symbiotic relationship. People want to live where they might be able to find work. Even if they have a job, they have to think about what will happen if they lose their current job. Companies want to be located where they have the largest pool of potential employees.
From time to time there are shifts in which locations are the most popular. It probably starts with a couple of small companies being in a certain place at a certain time. When the companies start to grow, people take notice. This attracts more people and more companies, which attracts more companies and more people, which attracts more people and …
Before the dot com boom, San Jose was not a very desirable place to live. Before Microsoft, Seattle was mostly Boeing and military.
And then of course you have the opposite in places like Michigan. Detroit was huge until the U.S. auto industry started to crumble.
San Diego used to be that little town where Angelinos spent their weekends (or drove through on their way to Baja). But over the past 10 years or so that has changed dramatically. Some changes are for the better and some are for the worse.