In the United States, presidents are not elected directly– instead, each state’s votes are tallied and the winner receives electoral college members who then cast votes for president. It’s a complex system that’s leftover from the Constitutional Convention of 1787 when American democracy was still, shall we say, getting her sea legs (it was the same convention that decided African Americans were worth three-fifths of a person).

In theory, the system works so that the average citizen votes by proxy: they vote for a candidate, and based on how many people vote for that candidate, the candidate is awarded the state’s electoral college votes, to be apportioned among its campaign supporters. Those supporters, who have been hand-picked by the campaign and are generally considered to be loyal to the candidate, are the ones who actually ratify the election by voting for the candidate.

But sometimes things don’t work out as planned. It turns out, 158 electoral college members have voted in a way other than the people of their state. Sometimes the reason for becoming what’s called a “faithless elector” is somewhat understandable: 63 of these 158 were cast differently due to Horace Greeley’s untimely death which occurred after he lost the election of 1872 but before the electoral college had a chance to vote).

Other times, the electors decide to go their own way for ideological reasons. This was the case in the election of 1872 when all 23 electors from the state of Virginia– which was pledged for the Democratic candidate Martin van Buren– refused to vote for van Buren’s vice presidential candidate, Richard Mentor Johnson, because the mother of his children was black. He wasn’t officially married to her because it was illegal, but he treated her as his common law wife.