...which is based on each state's popular vote. If a state comes out with a majority vote for the Democratic party, the electoral college assigns its vote for the Democrats. It's not some independent function that thinks on its own, it's just a way to rationalize what's called 'tyranny of the majority'.