All Apple had to do to ... was to have their own factory in China
Like that is easy.
Companies use organizations like FoxConn for a reason: cost is one of them.
Expertise is another. Apple is good at what they do. Being able to make the stuff they design requires a whole 'nother corporate skill set.