What role does the electoral college play in selecting the President?

The electoral college is the process used to select the President.

When people vote for President they are actually voting for an elector, or a representative. The number of electors in each state is based on the number of representatives that state has in Congress. So, whatever candidate receives the majority of the popular vote (individual votes cast) in a state receives all of that state's electoral votes.

This system was designed so that smaller states still had a good say in the outcome of the election. One of the chief complaints of the electoral college is that it is possible (and has happened) that a candidate might win the popular vote (overall individual votes) and lose the election.

How is it possible for a candidate to win the popular vote yet lose the election?

The margin of victory in a state doesn't change the number of electoral votes given to a candidate. So, if a candidate wins State X by 70% to 30% margin of victory they get 25 electoral votes. But, if a candidate wins State X by a 51% to 49% margin of victory they still only receive 25 electoral votes.

So, what happens is that Candidate 1 might win several states by a huge margin and Candidate 2 might win several states by a small margin. When popular votes are counted Candidate 1 might have a small majority of votes. But, when electoral votes are added up Candidate 2 has a majority of electoral votes because they won more states (or more large states), just by a small margin of victory. The huge margin of victory made by Candidate 1 might have given them more popular votes but it didn't increase their electoral vote count.