That depends. The US is really cheap if your factory is fully automated, and Apple makes enough phones that full automation seems like it should be a win. For smaller production runs cheap labor is cheaper than the cost of building automation. Optimizing these curves is hard. (Note that China is really a lot cost of labor country anymore, and so production is moving away, but this is a long slow process, not to mention China is investing in automation and reportedly doing well)