Most of the technology needed to automate electronics manufacturing has been available for years, if not decades. See "The Macintosh Factory", showing Apple's factory in Fremont over 20 years ago. Robot assembly, mobile robots, very few people doing direct labor. Products were designed for cheap automated assembly. The Macintosh II family was noted for that - everything, including the power supply, was inserted into the case with a simple straight-down move. Everything snapped together. No wiring harnesses. "Design for manufacture" was big back then.
So what went wrong? Outsourcing for cheap labor.
"If your orders decrease, you can lay off workers. You can't lay off robots." - Tim Li, Quanta Computer. It's not so much that people are cheaper. It's that they are disposable. So are subcontractors. Everybody in the supply chain is working on low cost margins with no guarantee of future orders, so they can't invest in automation.
This is not a technical problem.