I pointed this out on another thread. There was a sense of contempt to the electorate, some of which was from Clinton, e.g. the "basket of deplorables," comment. It was almost, "We know better than you do, and only need you to follow." That turned off a number of voters.
That happened in the GOP primaries, where it directed against Trump. Trump, for all of his foibles, didn't do that. Yes, he attacked illegal aliens, but they are not part of the electorate.
Clinton also moved very far to the left, compared to where she was in 2008. As I've said, I liked the Hillary Clinton I saw in 2008; I wish she had turned up in 2016, because I would have voted for her.
That and the identity politics as well "racist, sexist, homophobic, xenophobic Nazis", people were tired of being berated by an old, corrupt bitty.