I worked for an international company once that had multiple world-wide locations and would send employees out there to work for six months to several years. (An acquaintance spent two years in Shanghai for them). My understanding was that the company handled all loose ends, from moving logistics to visas and tax returns. It was worth it to have people who understood their business in place there - supposedly.
Absolutely. I used to run the American Chamber of Commerce in Indonesia, many many years ago. At that time most of the members were American (or sometimes other foreigners, who were cheaper to employ because they came from countries that unlike the US did not tax the income of their citizens abroad). But, that has changed a lot over time.
Today many of the high level roles in the foreign offices of US companies are filled by local citizens. It certainly makes financial sense and may also be practically advantageous, as the locals understand the local environment better. There are a lot of factors in play, it’s not a one-size-fits-all situation.
One of the worst cases was Japan back in the early 90s. I had a friend who worked for a large US company, and they not only normalized the take home income, but also they allowed the employee to rent a place that would be the equivalent size and commute time to their New Jersey headquarters.
He selected an American sized house a 15-minute walk from Shibuya, with rent IIRC, about the equivalent of US $25,000. Per. month.
As this exceeds the allowable exemption by the IRS for overseas employees, the company then needed to pay tax on the amount they covered for rent, above the allowable exemption.
According to my friend, then the money the company spent to cover this tax then is treated as income and the company then needed to cover that. As this would escalate yearly, ex-pats from that company would only be sent over for one to three years.
I have a Taiwanese friend who is living in Japan, but works for the Taiwanese office of a US major manufacturer. As he is Taiwanese and not American, there aren’t any issues with the IRS, but there still are questions concerning employment rules and if he has to be registered with the Japanese branch office.
Could be worse. One ex-pat employee from Indonesia disappeared on the way back to North America. They found him a week later - seems he’d waited until the last day of his visa to leave. Indonesia at the time (way back when) was incredibly corrupt, and the customs people saw an opportunity for a shake-down; hold him up with questioning until midnight, then charge him for overstaying his visa. Not sure what it cost to get him out, but it was held up as a lesson to all ex-pats - “don’t wait until the last day…”
The government doesn’t care, the employer may not want you to for a number of various legal concerns.
To get off topic but based on the OP: when the IRS sleeps at night, it has nightmares about California’s Franchise Tax Board. They do not mess around, make sure both you and your employer learn the rules for working outside of California with California-based income. The FTB may think you owe money in certain situations even if you and your employer don’t think so.
If the employer is a federal contractor, it may be required to onshore all of the relevant work. The same is generally true of any state government that uses a contractor.