Well, it doesn't do that in practice. The electoral college which goes against the will of the voters will quickly become the last electoral college. As it's politically untenable for the electoral college to do anything but heed the will of the voters, it's vestigial. All it does is get in the way of a democratic election.