Since the 2000s, companies have been attempting to off-shore expensive cost centers for their businesses. This primarily includes technology for line of service software.
The MBA thinking goes like this: we need to maximize the parts of our companies that make money. Those are Profit Centers. Then we need to sell off and minimize the costs to our companies. Those are Cost Centers. Our XYZ business doesn't involve making software so let's minimize that as much as possible. We'll hire as cheap labor as we can from third world countries because its not value we provide to people, its not in the profit center, and we can pass those savings onto other things.
You saw this first happen with manufacturing. The cost to make the stuff is a cost center -- literally -- so companies like Nike went as cheap as possible. They used the savings to do better marketing.
It worked because shoes are a low cost product. If they fail its unlikely to hurt anyone. Stuff like structural steel and medical equipment are still mostly made in first world countries. The former also got help from tariffs.
Software falls into that latter category -- sometimes. Some companies really don't need much software. They can get by with "as cheap as possible, not even in-house if we can avoid it." Other companies need software to be extremely high quality because it is a competitive advantage.
Some software companies have the landscape shift on them.
Retailers, like Target, reshored their software teams. Why? Well Amazon happened. It became necesary to have great software because it was now a competitive advantage. You couldn't slouch on this effort because an awful and slow website and app would kill your business.
There is another interesting example of this: aerospace. Their software is like structural steel in that it will be deadly and costly in mistakes if it fails. Yet they spent $9 an hour on engineers for their recent failure. What gives?
Well aerospace is part of a series of protected industries in the United States. The federal government will never let these companies fail for national security reasons. These companies can get away with a lot as a result. There's no point in reshoring in a "heads I win, tails you lose" situation.