> It's not. You can't simply employ foreigners, you won't be able to do the administrative work and you can easily get into trouble for employing illegals.

Tangent: Most countries do technically allow foreign companies to directly and legally become employers in their country without having to involve any kind of additional legal employer entity, and in many cases such branches (as they're called) of the foreign entity can do the required formalities to legally employ foreigners. But yeah, there are usually significant compliance and liability/financial downsides to the branch approach. S most multinational companies do tend to prefer one of the two approaches you describe.

> So when companies pay remote workers, they often have a representation in that country. This usually means(depending on the country) that the American company that "employs" these remote workers actually pay money to a company in the poor country and that company pays the local taxes and the workers. There are companies specialising in this, so they setup companies in many countries and when you hire a remote worker from legal point of view the worker actually works for this intermediary and pays local taxes. Another popular option is, to setup your own company and do the same thing but skip the middleman.

Although you're right about this, the cost to the employer of such an intermediary company is hundreds of USD per intermediated employee per month, nowhere near the typical reduction in compensation for that employee for being in a poor country rather than a rich country. So it isn't the full explanation.

My take is it's honestly mostly just companies getting away with what they can get away with, in the usual economics supply-and-demand system. Hiring obstacles haven't yet forced most companies to change their definition of their labor market into "anyone who can somehow legally work for us (whether directly or indirectly) during work hours that overlap sufficiently with our core hours and without causing us to incur unreasonable compliance and/or travel expenses." They still set compensation using a per-location definition of the market based on who can commute to an office that no longer exists in the context of a remote worker.

Of course, switching to a truly remote-first labor market definition would probably involve paying lower salaries than the current SF and NYC market norms, at least in the tech industry. This makes correct compensation a complicated question for employers, when they recognize the remote-first labor market reality but also want to hire the top-notch caliber of employee who often chooses to live in such major tech hubs. But equally, such employees increasingly want the higher disposable income after adjusting for cost of living that allows them to take a slightly lower salary in other cities or countries and still come out ahead. So this just means that a transition to a remote-first definition would involve some iterative adjustments on both sides as a new economic equilibrium shakes out. We're probably in the first stages of this now.

Last note: It is true that benefits like health insurance and social security contributions will usually continue to vary in nature and magnitude based on local country norms; however, one of the countries where these (especially health insurance) are usually priciest is the USA, which also has the highest salaries, so people who try to use this variation as an excuse for salary differentials are either confused about the data or being disingenuous.