As others pointed out, CoL is also way lower in most parts were there are relevant jobs to be had.
I am working a job that would pay at least double in SF. I can afford to pay the mortgage on a 130 square meter house with 500+ square meters of garden and relax by growing my own food as a hobby with 40 hours per week, 6 weeks of holiday, paid overtime, really good health care covered by insurance.
I live in one of the four largest cities in Germany. So I benefit from the infrastructure like theater, Medical stuff and so on as well.
And also the ability to start a business on the side with filling out a single form.
And I am able to generate FU money from my main salary, go on trips, give to charity and such.
Reading about insane prices for living in SF or other tech regions puts a damper on the high salaries IMHO.
But I also define my life not by the amount on my pay check.