The Information has a great deep dive into how Apple learned that humans can actually surpass automation. There is also a good write-up over on AppleInsider.
Since Apple redesigns its major hardware in at least some way every year, it would also have to redesign the automated factory lines. Compared to that, training workers on new designs is vastly easier and quicker. Plus, one reason both Foxconn and Apple were interested in automation is that as well as being dependent on workers, that dependency fluctuates greatly. Foxconn was having problems recruiting enough staff for the peak periods just after, say, an iPhone launch. Automation would theoretically reduce that problem, but Apple already has a way of removing it. When it needs to, Apple is currently able to switch production to other companies. If there’s a problem or if more production is needed, it has alternative sources it can leverage.
Check It Out: How Apple Learned Humans Beat Automation