Outsourcing doesn't have to be based on pure time&material model. Software houses have huge incentives to become more efficient - using scale to their advantage, becoming experts in technology, etc. - all that to compete with other software houses.
I know from first-hand experience that this isn't the case.
Obviously T&M is the preferred contract structure for the service provider, but many projects get done on different metrics (fix-price, result-based, T&M with upper/lower bound etc.). It's quite a competitive industry, so a big client can negotiate for a different contract structure if the project allows it (obv. not for bodylease stuff).
Also, your assumption about labour-cost arbitrage isn't completely true. Many external consultants (incl. developers) make better salaries than internal staff.