The number of electors each state has is determined by the number of representatives a state has, plus its two senators. No state can have fewer than three electors. There are 435 representatives in total and 100 senators. The 23rd Amendment to the Constitution awarded Washington, D.C. three electors. Combined, there is a total of 538 electors.
Electors usually vote for the winner of the popular vote in their state. In some states, they vote depending on the popular vote in each congressional district. The Constitution leaves states to decide how electors will vote. Faithless electors are electors that vote against the popular vote, although there is a fine for this in some states.
The Electoral College was created as the Founding Fathers were afraid the popular vote would be easily swayed. Because congressional representatives is determined by population, electors are assigned based on representatives. More populous states have more electors. Because most states have a winner-take-all system, where the winner of the popular vote in a state gains all of the electors, several presidents have lost the popular vote and won the electoral vote. A candidate needs to win a majority of electors, or 270, to become the president-elect.
The Electoral College plays a very important role in today's elections. It is the subject of controversy as some people approve of the system, but for various reasons, some don't. The people who approve of the system often argue and say that it gives smaller states more power, and that this a good thing, because if it were done by population, someone could win a majority of the votes in certain states but not win the majority of states. The Electoral College favors those who win more states, big and small. Even though it can be won with 11 states, often certain states stay Democratic or Republican ensuring it likely won't happen this way. Those who are against it bring up the latter argument that it can be won with 11 states and often the candidate who wins does not win the popular vote. Third parties can change the outcome of an election, and it is often debated whether they play a role.
References
↑This number is reached by adding the 435 Representatives, 100 Senators, and 3 electoral votes for the District of Columbia