As the reality of President Donald J. Trump sets in, dismayed progressives will try to apportion blame between a Trump-enabling, substance-ignoring media, Republican vote suppressors in state legislatures and the federal courts, Hillary Clinton’s weaknesses as a candidate, irresponsible third-party runs, and various other factors.

But we shouldn’t lose sight of one simple fact: By the standards used to conduct elections in virtually every liberal democratic jurisdiction in the world, Hillary Clinton won. As I type, Clinton has a popular vote lead of about 150,000 votes, and when the ballots from West Coast states are counted, her lead is likely to expand substantially to a million or more. The American people, in other words, chose Hillary Clinton. She lost because the Constitution does not choose the president democratically.

It’s very likely that, had the Constitution been framed and ratified even a decade or two later, the president would have been chosen by direct popular vote. Not only does no other comparable democracy use any system like the Electoral College, no American state does (although the Constitution leaves them free to use the electoral system of their choice so long as it is consistent with “Republican” government). And Donald Trump is an all too logical product of the Electoral College’s deficiencies. As Yale Law School professor Akhil Amar put it in 2000, when Al Gore both won the popular vote and lost the election, the Electoral College “was designed at the founding of the country to help one group—white Southern males—and this year, it has apparently done just that.”

The Electoral College was essentially the product of two imperatives, neither of them very attractive. First, it reflected the belief of many framers that the “excess democracy” shown by state legislatures that had passed debt relief legislation needed to be curtailed. (It is not a coincidence that the Constitution of 1787, even after being amended by the Bill of Rights, did not protect the free speech or due process rights of citizens against state legislatures, but did prevent the states from passing any “Law impairing the Obligation of Contracts.”) The Electoral College was meant to act as a “filter” between the people and the White House. And while the idea that the electors should exercise independent judgment quickly became discredited, the Electoral College remained to potentially bequeath the White House to a candidate who is not the choice of the people.

The second major purpose accomplished by the Electoral College was to protect the interests of slaveholders. Slaves, of course, did not vote. But the Electoral College meant that slaves (who were counted as three-fifths of a person for the purposes of apportionment) would give the South extra clout in the Electoral College. And because Congress failed to adhere to its obligation under Section 2 of the Fourteenth Amendment to reduce the representation of states that disenfranchised voters, during the Jim Crow era the Electoral College allowed the South to be fully represented in the selection of the president even as it denied the right to vote to a large segment of its population.