Like, I’m a US citizen and have basic programming skills. Not long after college I landed a software engineering job and I immediately have access to markets like SF or NYC, all I have to do is pack up and move (and it turns out I don’t even have to pack up, because relocation packages include it).
Let’s say you’re from Syria and have a similar set of skills. This sounds hypothetical, but I’m thinking of a specific, real person here. You go to college in the middle east, eventually get a tech job doing operations work in the EU, get an intra-company transfer to the US, have to deal with US govt. questions to work in tech or get a bank account, and then eventually transfer to a software engineering job.
At the same point it makes complete sense that there are dense clusters of highly skilled software engineers in a few places, like SF, and if you want access to that talent pool you have to pay them enough money to make rent.