Here are 24 possible reasons why Donald Trump won.
If I had to pick three they would be, 4, 12, and 14
If I had to add a few it would be,
25. Because of the electoral college (although I tend to discount how important it is compared to some others)
26. Because he struck a home run on Nationalism. Most of Trump's "racism" is nothing more than innocent nationalism (nationalism is a synonym with Xenophobia by the way)
27. Because the left got too associated with the far left social justice and Bernie Sanders types. Bernie wouldn't have won, he wouldn't have even come close. Bernie is political poison and most voters don't want anything to do with it.
Essentially, Trump is a branding machine. The brand voters were faced with Trump = America and Democrat = Bernie/Social Justice. Obama took over the liberal brand far better than Hillary did.