First, keep in mind that the United States is not a popular democracy. It is a representative democracy, a republic, as the writers of the Federalist Papers never tired of pointing out. The electoral college was, to be sure, a compromise. And it undercut the ability of a tyrannical but geographically concentrated majority to impose its choice of chief executive on the rest of the country. Simply because the framers knew that the interest of the majority did not always equal the national interest.
Majorities can be factions too.
After all, arithmetic majorities of Americans supported slavery, the internment of Japanese-Americans in World War II, and the crusade against the First Amendment led by Senator Joe McCarthy. The electoral college is an important additional component. There are two specific sets of otherwise disparate minorities who are empowered by the electoral college. The first comprises the residents of small states, which the electoral college somewhat over-represents. The second group is made up of racial and ethnic minorities in large states.