Export the manufacturing base/New Machinery

Quick question. When a country exports its manufacturing base, to say, China or Mexico, would it be the same as factories becoming fully automatized and firing all their workers save the engineers required to operate the machines? In pure economic terms it’s better if its cheaper regardless if the product is being brought in from China or giving jobs to aforementioned Engineers here?