Say I'm living in Nowhereville, USA, and working for the tech company there. If anything goes wrong, for example, an overall tech downturn, this company hits hard times, or I have a job-ending disagreement with my boss, then getting a new job likely means a 6+ month job search, uprooting my family and moving. I know this is true because I have lived in several towns like this. It sucks.
In the Bay Area, if things don't work out with a particular company, I can apply to hundreds of others next door. I'm in for a 3-6 month job search, and at the end of the day I don't have the hassle of moving to a different city.
Stay near one of the top 100 cities in the country and there are almost no issues with employment if you keep your skills somewhat updated.
Edit: I should mention I, and all my co-workers, also don’t work remote. Turns out companies everywhere use technology :)
In 2012, I walked out on a contract job on Monday during lunch (long story), called a recruiter and I had a job offer with what was then a Fortune 10 company by Thursday evening making 10K more.
In late 2014, I called recruiters and had two job offers making 25K more.
Earlier this year, it took 10 days and now I'm making yet another 20K more.
I'm no special snowflake. I'm still just making the median salary for Atlanta, a lot of my former coworkers can tell a similar story.
When I'm looking for a job, usually I'm juggling between 5-10 opportunities. I always use recruiters, so I am not blindly submitting resumes.
You might be able to pick up a new job overnight in the Bay Area, but conversely your employer can replace you overnight in the Bay Area. Friends who went out there are constantly jumping between companies as they run the risk of being laid off, of running into stack ranking, of their firm getting bought out or all other kinds of nonsense.
Midwestern friends? All still working for the same spot they got out of college. Pay might be low, but the stress is low as well since employers know that it's hard work to replace a competent developer (probably have to pay someone to move there). If they walk out, it's the firm that's going to be in a harder place then they will be -- so no one is going to ask them to work overtime, check their e-mails, or do anything to upset their applecart.