The US government can tax the factory and spend the tax revenue on average Americans. The German government for example gets a big fraction of its revenue from taxes on export industries that employ only a small fraction of Germans.
The German export manufacturers show no great desire to leave Germany -- or at least they didn't till their energy supplies became very expensive in the wake of the Ukrainian invasion.
But, how does changing some number on a "trade deficit" spreadsheet materially affect Apple or Americans? Apple pays slightly more taxes to the government than it did before. Big deal. There is no incentive to demolish an automated factory in China and re-build it in Nebraska.
Apparently the US can sustain a trade deficit with the rest of the world, but certainly this ability to sustain one is not unlimited, so lowering the trade deficit tends to help Americans by making it more likely that the US economy can continue to import things (including some things are are available only outside the US, e.g., fruits that only grow in tropical climate).
If the trade deficit becomes or continues to be unsustainably large, that would devalue the dollar so that Joe's dollar buy less imports than it does now.
There are hints of a strange energy to your questions, which does not bother me, but I am curious whether you feel hostile to me, e.g., because you inferred from my answers that I probably support a political faction that you regard as the enemy.
Not really, you seem to think that the location of an automated factory which employs basically nobody makes a material difference to anyone, and I'm trying to work out what that is
America will gain the know-how how to make such factories and maintain them. Use the knowledge and experience to make more such factories in other fields. A whole industry can grow around it. Do you think factories in China pop-up like mushroom after rain by them self and there is no industry and jobs associated with building highly automated production lines?
You'd need to site it near to the Grand Forks air force base (almost Minnesota) because that's the only runway in state capable of handling 747 cargo flights.
The factory can go anywhere, in China, in France, in California, in North Dakota.
What benefit is that to the average American citizen?