In 2016, Democratic candidate Hillary Clinton got more votes for president than her opponent, Republican Donald Trump. In 2000, Democrat Al Gore got more votes than his Republican rival, George W. Bush.

Yet neither Clinton nor Gore became president.

That’s because the president of the United States is not directly elected by the popular vote. When Americans go to the polls, they are actually voting for “electors,” people in their state who have promised to support a specific candidate in a process called the electoral college. (No, it’s not really a college.)

Each state has a number of electors equal to its number of seats in Congress. The minimum is three. California, the most populous state, has 55.

Forty-eight states and the District of Columbia, which also gets three electors, follow a winner-take-all system. The presidential candidate who wins the popular vote in that state gets his or her slate of electors selected. (Maine and Nebraska use a different method.)

There are 538 votes in the electoral college. To win, a candidate needs at least 270 votes. If no one gets that many, the newly elected House of Representatives decides the winner.

So how is it that a candidate can win the national popular vote but not win the election?

Let’s use 2016 as an example. Nationwide, Clinton got nearly 2.9 million more votes than Trump. But her votes were clustered in a few, more populous states, so the “excess” didn’t help her electoral vote total. Trump, by contrast, won several less populous states and rode the winner-takes-all system to victory.

For more history on the electoral college, read this KidsPost story.