Speaking from experience,
American Programming job at A costs $80,000.
Indian Programming job at A costs $30,000.
American Programming job at B costs $80,000.
Indian Programming job at B costs $45,000.
The admin costs of dealing with foregin companies is pretty much negligible in the equation and it still costs a hell of alot more to employ an American.
Except what is produced isn’t the same.