Outsourcing happens from top to bottom. Branded drugs are still manufactured mostly in developed countries.
Generic drugs are thin margin high volume business
Companies can get some edge over competitors by scale, cost-effective manufacturing process, intellectual property, or investment barriers.