The Electoral College was created during the 1787 Constitutional Convention as a way to prevent the people in the states with large populations from completely dominating the people in the states with smaller populations.
The men who wrote the Constitution feared the tyranny of the najority that would result if a direct popular election of the President were to take place.
They wanted Presidential electors from each of the Congressional Districts to vote fo the candidate of their choice rather than the most popular candidate.
They wanted to choose wise men of intefrity to elect the President rather than a majority of ignorant and uninformed voters.