In short the Electoral College works as follows: 538 electors are allocated to states as the sum of the senators (2 for each state) and representatives (proportional to population). In most states, each voter picks a single candidate and the candidate that wins the most votes receives all of the electoral votes for that state. The candidate winning the majority of the electoral votes becomes president. More details here.
In computer science terms (assuming two candidates), we have a weighted majority of majorites or a depth-2 neural net. It has some properties that you would want:
- Monotonicity: If a candidate wins the election and more people vote for him, he will still win.
- Fairness: Barring a tie, if all the votes were switched the other candidate would win.
The United States is just that, a collection of fifty states each with their own laws, cultures and economies, united under some common priciples. A simple majority would have the large populations centers overwhelm the rest of the country in choosing our leader. A majority of majorities would give some states far more power than their size would dictate. So a compromise was formed, a weighted majority of majorities to give small states some but not too much influence. The fact that this process does not always agree with majority is not a bug but a feature that preserves the balance between small and big states, rural and urban America. It also keeps balance between states of the same size, an lopsided vote in California would not overwhelm a closer vote in New York.
Some things I would change in the Electoral College: Electors should be required to vote for the candidate they represent; for each state we should have a ranked voting method instead of plurality takes all; the tie-breaking rules should be changed, now they give too much power to the small states.
The winner of the World Series in baseball is not the team that scores the most runs but the team that wins the most games, a majority of majorities and most people feel it gives a better indication of the better team. Why shouldn't elections deserve a system at least as sophisticated?