The winner of the presidential election isn't necessarily the candidate that gets the most votes nationally. Instead, candidates compete to win electoral college votes. Each state has a certain number of electors and how the electors vote is based on how the people in the state have cast their votes, and in general, all electors vote for the candidate who won the state referendum. In order to become President of the United States, a candidate must get more than halv of the electoral college votes - more than 270.