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?