With an expected win in the Electoral College today, Donald J. Trump will seal his presidential victory — despite losing the national popular vote by a significant margin.

His Electoral College lead should be substantial, since he won states worth 306 electoral votes to 232 from states won by Hillary Clinton. Yet the nearly final popular vote count has him trailing by nearly three million votes, or 2.1 percentage points, the largest deficit for a winning candidate since 1876’s notorious election.

How exactly did we end up with such divergent results?

Liberals say Mr. Trump’s victory is proof that the Electoral College is biased against big states and undemocratically marginalizes urban and nonwhite voters. Conservatives say the Electoral College serves as a necessary bulwark against big states, preventing California in particular from imposing “something like colonial rule over the rest of the nation,” as the conservative analyst Michael Barone put it. California sided with Mrs. Clinton by a vote margin of four million, or 30 percentage points.

Both sides have a point. But in the end, Mr. Trump won for a simple reason: The Electoral College’s (largely) winner-take-all design gives a lot of weight to battleground states. Mr. Trump had an advantage in the traditional battlegrounds because most are whiter and less educated than the country as a whole.