Though the Electoral College took an unpredictable bounce in Trump's favor, it was Gerrymandering by Republican dominated state legislatures that legally "tipped the scales". In addition, hundreds of poll closures in minority dense areas in southern red states with past experience in voter disenfranchisement really "did the trick". It was the 2013 modification of the Voting Rights Act of 1965 by the conservative Supreme Court that both allowed and encouraged it.
"There Are 868 Fewer Places to Vote in 2016 Because the Supreme Court Gutted the Voting Rights Act":
"This was the first election without the full Voting Rights Act — and it's already a disaster"
This day in history voting rights act:
Voting Rights Act of 1965
Shelby County vs Holder: