How does the Electoral College work?

The Electoral College was devised at the Constitutional Convention in 1787. It was a compromise between those who wanted direct popular elections for president and those who preferred to have Congress decide.