It's interesting to view the Trump election in light of the ongoing conversation about automation and AI ending human jobs.
It's as if the socialist public works programs the left has always wanted more of are finally getting put on the table, but via a rightist, nationalistic, paranoid and xenophobic nativism. National socialism, you might say.
Of course, military employment has long been something of a compromise between liberal supporters of socialistic full employment and the jingoistic right.
In this light, Trump's proposed import tariffs are effectively a proxy for subsidized employment. But they are a very poor proxy, in terms of economic efficiency, since automated manufacturing requires so few jobs anyway--especially when those jobs need to pay relatively high American salaries.
What we really need is socialized income to distribute the gains from technology, and socialized jobs to keep people off oxycontin and video games. So again, public works and high taxes.
The impetus for this, ultimately, is the same as the welfare state in general--maintaining stability and staving off revolution. (That need not mean actual discrete political revolution, just the undermining of an existing power structure.)
Horses are famously held up as an example of what happens to an obsolete workforce; apparently the horse population of the developed world has declined to a practically genocidal degree in the last century or so.
If the horses had guns, maybe they'd still be around!