The winner of the US presidential election is not always the candidate who wins the popular vote – the path to victory is to win a majority in the electoral college.
Each state has a certain number of electors, who elect the president – big states have more of them than little states – and the trick is to win enough states to stack up 270 electors’ votes.
See the very cool interactive maps, and the rest of the story here.