The Electoral College is part of the system of checks and balances in the US system.

My understanding is that the US founding fathers felt the selection of President was too important to be a popularity contest and should not be left to popular vote.  The members of the college should be men (and today women) of good standing and sound judgement in the community.

I don't think it has ever actually functioned that way.

However, one thing it does do is protect the interests of the smaller states from the predations of the larger states.  It does this by giving the smaller states slightly more say in selecting the person who will hold the most powerful office in the nation