This is because the Electoral College awards all of a state's electoral votes to the candidate who wins the popular vote in that state, even if the candidate wins the popular vote by only a small margin.