In theory, jobs put an upper limit on housing usage. People almost always follow jobs.
There are many beautiful cities in the world but only SF is near Silicon Valley.
You can find cheap housing in nice areas if they don’t depend on jobs (college towns, retirement communities).
People will present counter examples at the margins of course, but generally the relationship holds.