How a shift in support among different groups added up to Trump regaining the White House.