The President and Vice President of the United States of America are not elected directly by the people. They're chosen by 'electors' through a process called the Electoral College.
The method of using electors comes from the Constitution. It is a compromise between electing the President by a popular vote among citizens and electing the President in Congress.
Number of Electors:
#The number of electors each state gets is determined by how many members of Congress (House and Senate) the state has.
#There are a total of 538 electors in all that includes Washington, D.C.'s three electors.
#Each state's political parties choose their own potential electors.
#After a person cast her/his vote for President, the vote goes to a statewide tally.
#In 48 states and Washington, D.C., the winner gets all of the electoral votes for that state.This means his or her party's electors in that state will vote in the Electoral College.
#A candidate needs the vote of at least 270 electors which is more than half of the number to win the Presidential election.
#The Constitution doesn't require electors to vote according to the people they represent. But it's rare for an elector not to follow the people's and their party's choice.