VC are in SV and they want founders/CEOs close by. And founders/CEO want their engineers close by.
But honestly even if you really need your headquarters in SV (for VC money, network, saying you're a "Silicon Valley company", etc) your best bet is to open offices in other locations to hire engineers. Not only they can have a better standard of living even if you pay them less, but you will have less competition to hire and retain engineers.
- Google bought the Port Authority building, which is like 2 empire state buildings in terms of office space. They have plenty of engineers working there: https://www.wired.com/2010/12/google-nyc/ This year they bought the building next door: https://www.blog.google/inside-google/company-announcements/... - Apple has a large campus in Austin: http://fortune.com/2016/09/01/apple-austin-campus/ - Amazon's obviously diversifying "HQ" locations
The question is why companies hiring engineers by the thousands every year keep pushing to open more offices in the valley. Why is it ideal to shift HR and accounting away from the west coast but keep engineering local?
So those who did mid-level things like accounting or office administrative work could no longer find work locally and either had to move or take a lower paying service worker position at Walmart.
Essentially what that reveals is that most of these mid-level jobs are susceptible to the Balassa-Samuelson (BS) effect [1]
Which means that most jobs that do not require physical labor onsite are either being rapidly outsourced to cheaper markets or automated if possible. This ends up being that group in the middle of the pay range and likely accounts for the reduction in overall wages for that group.
[1] http://www.bankpedia.org/index.php/en/87-english/b/23137-bal...