I don't think that the code created for example at Google Warsaw is worse than code created at Google Mountain View (you can even check yourself, people in Warsaw work on Kubernetes, which is open source). And yet, the Warsaw salary is maybe 30-50% of the salary in MV.
I don't know the situation in other countries, but in Poland Google's approach is rather typical. American corporations typically just set up an office here instead of buying services from some shady local offshore company. I don't see much of the latter around (and incidentally, the big ones are American as well - IBM, Accenture etc.)
Depends on what do you mean "live better". iPads, cars, plane tickets, electronics and other luxuries aren't cheaper in Poland than they are in US. You might "live better", but you also might never be able to visit Hawaii or drive a Tesla.
Depends on your living situation. If you want a house in the suburbs with not terrible commute, it's going to cost you $200-400k in Warsaw vs probably three times as much in SV? This (and higher taxes in the US) can probably consume a lot of the salary difference. But, on the other hand, if you're ok with living in a small studio, you're going to make bank in SV.