How much of the shift took place because of trade is hard to tell: The job losses mostly took place during the first decade of this century, but the states did not flip to vote for a Republican until this year. And many other issues were in play, including tensions over immigration, race and the presence of a woman on the Democratic ticket.