Businessman Donald Trump was elected to be the 45th president of the United States on Tuesday, winning at least 270 electoral votes despite losing the popular vote count to former Secretary of State Hillary Clinton.

The Electoral College is complicated. So we’ll try to explain it.

Technically, U.S. voters don’t choose the president

Instead, they choose a slate of electors who officially vote for president on Dec. 19. So when a candidate “wins” a state in a presidential election, that candidate’s party’s slate becomes the state’s official electors. The Electoral College gives each state a number of electoral votes equal to the number of that state’s representatives in Congress. The District of Columbia also has three electoral votes, for a total of 538.

All states but two — Maine and Nebraska — have winner-take-all systems, in which the candidate who wins a majority of votes in the state receives all of that state’s electoral votes. In Maine and Nebraska, two electoral votes go to the winner of the state’s popular vote, and one electoral vote goes to the winner of each state’s congressional district.

A candidate must receive 270 electoral votes to win a majority and win the presidency. In the event that no candidate receives 270, the House of Representatives decides the election.

So, how did we end up with this system?

At the Constitutional Convention in 1787, the framers considered several different methods for electing the president. They wanted to ensure the executive branch would remain independent and effective, but still accountable to the country.

Congress could elect the president, but James Madison feared this would establish an “improper connection” between two branches of the government. Members of Congress would be more informed about the candidates running than the average citizen would. In the 18th century, with travel difficult and no “mass media” like we have today, the vast majority of American citizens would never see or hear the president, or know enough about presidential candidates to cast an well-informed vote. Elbridge Gerry, who later became Madison’s vice president, warned against direct election by saying “the people are uninformed, and would be misled by a few designing men.”

There were also more political arguments against direct election by the people; in an election by a direct popular vote, small states feared they would be overrun by states with larger populations. Southern states also opposed popular election, as they would lose the three-fifths advantage they enjoyed in Congress: Their large slave populations could not vote, but were counted as three-fifths of a person for purposes of congressional representation.

Historian Shlomo Slonim writes that the Electoral College was crafted as an “ad hoc Congress” that would allow states to maintain the representation scheme of Congress without actually having Congress involved in electing the president, protecting the interests of small states and slave states. It wasn’t about the mistrust of democracy, but instead was a compromise among the states, according to Slonim.

Pros and Cons:

Historian Alexander Keyssar has called the Electoral College “a flawed and archaic institution” that has “long ceased to serve the deliberative function for which it was designed.”

Keyssar would like to abolish the college altogether; he writes “its granting of disproportionate weight to voters who live in the small states looms as an overt contradiction of the principle of ‘one person, one vote’ that is at the heart of modern conceptions of democracy.” He also takes issue with the fact that there is no right to suffrage protected in the U.S. constitution.

But in 2012, judge and law lecturer Richard Posner gave five practical reasons for keeping the “despised method of choosing the president” around.

Among them, he wrote that the Electoral College maintains a certainty of outcome without disputes over the result or states seeking a recount. It also requires candidates to have a “transregional appeal” and prevent a regional favorite from carrying the election, leaving residents of other regions to feel disenfranchised.

There’s currently a change.org petition calling for the country’s electors to cast their votes for Hillary Clinton. According to the National Conference of state legislatures, 30 states have laws that attempt to bind electors to vote for the winner of that state, but electors can technically defect and pay a fine. But this isn’t realistically going to happen. A Vox article states Republican electors would have to abandon both their candidate and their party as a whole.

Even if some were willing to do that, Clinton would need 37 electors to defect to deprive Trump of his electoral majority, according to Vox. And they would need to actually vote for Clinton, or else the election would go to the Republican-dominated House of Representatives.

If this did actually happen, Vox’s Andrew Prokop wrote that it would likely end in disaster: “in addition to being unrealistic, this idea that the electors should simply choose to make Hillary Clinton president would be tremendously dangerous for American democracy,” he wrote.

Others are calling for the United States to abolish the Electoral College entirely. This probably isn’t going to happen either, as it would require a Constitutional Amendment, and amending the Constitution is hard: It requires a ⅔ majority in both houses of Congress or by a Constitutional convention called for by ⅔ of the states. Then amendments must be ratified by 3/4 of the states.

And no, Maryland has not “sidestepped” the Electoral College.

A 2007 Associated Press story writes that Maryland approved a plan to allocate its electoral votes to the winner of the national popular vote instead of the candidate who wins the state. But that plan “would only take effect if states representing a majority of the nation’s 538 electoral votes decided to make the same change,” according to the story.