Outsourcing is usually done as a cost saving measure, often in the knowledge that they might be getting less than before.
The cost savings are often overestimated and many companies can't evaluate quality well in the first place.
Also outsourcing doesn't always mean remote, lots of companies hiring consultants (developers, or even teams of developers) require them to be on-site.
The problem is often the outsourced and the company doing the outsourcing have incentives which don't line up.