The level of divergence of economic growth opportunities between some economic regions over others can make it rational for people to stay in a place they hate. Even if you can get a job in any other city, maybe it might not last for the next 10 years. The real risks in your life start coming around age 50 when your health starts faltering, and your healthcare costs go up and at the same time your employability might go down.
Also, quality of life as you get older in VHCOL like SF and NYC is definitely not as nice if you're not very high income. You spend all your time commuting to work, and I found that people were basically unavailable Mon to Fri. Whatever life they had was all on weekends, and even then it's allocated scheduled events. Whereas in less competitive areas, you can go have dinner at a friend or family's house after work on a weekday, and you can go to the gym, and be there for your kids because you're not spending 90 min + on the subway or train or having to allocate extra time due to public transportation service outages.