In 1787, when the Constitution was being drafted, the Framers didn’t want the president and vice president to be chosen directly by the people or by Congress. They wanted to establish a role for the states in national elections—in line with the idea of a federalist system of government. And they sought to protect the country from what they saw as an ill-informed populace. The Electoral College was their answer.
The Framers envisioned it as an elite group of men (there wasn’t a female elector until 1912) who could be trusted to choose the nation’s leaders. The system was also supposed to ensure that a candidate with overwhelming support in only one part of the country—which might enable him to win a slim majority of the popular vote nationally—wouldn’t be elected against the will of the rest of the nation. In some states, electors were chosen by the legislatures; in others, by popular vote.
Today each state’s political parties nominate slates of electors who are pledged to support their party’s candidates.