If you're building glass, or gaskets, or tiny screws, or LCDs, you want your factory to be in China next to the iPhone factory so the parts can arrive as quickly as possible. If you're building iOS, you can just upload it to the factory from California with comparable delay.
Until your manager decides three other programmers from China or India could output a larger quantity of serviceable code for half your wage. And the drop in cost nets him a bonus from his bosses. Until they offshore him, and only need translators to run their company.