Decision on outsourcing is not always made based on quality/cost ratio.
Sometimes it is just the cost. Because managers accountable for application services are looking to reduce the cost to please their managers and shareholers with the numbers.They are not taking into account the downsides of poor code - those gonna realize themeselves in rather distant future.
In addition, poor quality can always be masked somehow - quite often it...