Now for what the Electoral College is. Most nations do not use anything similar to elect their Chief Executives. Its name uses "college" in an earlier sense, "assembly", as opposed to the present sense of "higher-education institution".
The Founding Fathers considered various ways of electing the President, like state governors or Congress doing the voting. They decided on the EC:
Each state would pick some number of people to serve as electors, the total number being the size of that state's Congressional delegation. They would then vote separately, and their votes would be collected. If the vote was a tie, then the vote would go into the House of Representatives, with each state delegation getting one vote.
Alexander Hamilton advocated the EC in
Federalist Paper #68. He expected that the electors would have suitable knowledge and experience for deciding who would be a good President. He proposed voting separately to make the EC resistant to demagogues and foreign meddlers.
In short, the Electoral College was to be a sort of search committee.