President Obama's re-election was never much in doubt, except perhaps briefly when he took a plunge after the first debate and we didn't know where the bottom was. But by the end of the campaign, Sam Wang of the Princeton Election Consortium was giving Obama a better-than-99% chance of winning. Nate Silver of the New York Times, more cautious, put the odds Tuesday at about 90-10 in favor of Obama.

Those who point to the popular vote as evidence of a very tight contest, as much of the media did before the election, should consider two things: first, that is not the way the game is played here (unfortunately). If the popular vote determined the presidency, the Obama team would have put more resources into big states like California and New York to ensure that Obama would win the popular vote by a wider margin. Instead, the resources went into swing states, in order to ensure a victory in the electoral college vote.

Second, the country is nowhere near as closely divided as the popular vote indicates. That's because non-voters, who were about 43% of the electorate in 2008, favor Obama by a margin of about 2.5 to one.

Indeed, the resources and political power that Republicans mobilized in an effort to deny millions of Americans their right to vote, and to suppress voter turnout, raise serious questions about their legitimacy as a political party. A legitimate political party does not rely on preventing citizens from voting, in order to prevail at the polls, any more than a legitimate government relies on repressing freedom of speech or assembly in order to remain in power.

How did Obama win?

In this election, as in almost every presidential election for decades, the biggest block of swing voters has been white working-class voters (however defined: for example, without college education). No Democratic candidate has won a majority of white voters for decades, since the Republicans adopted their "southern strategy" in the wake of historic civil rights legislation, and became the "white people's party". (In fact, Obama did better among white voters in 2008 than John Kerry did in 2004 – his racial identity was not a handicap because most voters who wouldn't vote for an African American don't vote for Democrats.) But in this contest, Obama had to win enough of the white working-class voters in battleground states to win the election, while winning about 95% of African-American voters and a large majority of Latino voters.

This he did primarily by making a populist appeal to working-class voters, more populist than any major party presidential nominee in decades. In the last debate, which was supposedly about foreign policy, Obama repeatedly referred to Romney as someone who wants to make sure that rich people "don't play by the same set of rules" as everyone else. Throughout the campaign, his team attacked Romney for being a rich, unscrupulous politician who didn't care about working people.

Of course, it helped that Romney fit the stereotype – a rich corporate raider, a private equity fund CEO, who said he "like[s] being able to fire people", and paid less of his income in taxes than millions of working Americans. His infamous secretly-recorded remark dismissing 47% of Americans as moochers – "my job is not to worry about those people" – was a gift from God, and became one of the Obama campaign's most effective TV ads.

But for those who have followed Obama's political career, his re-election was always extremely likely – and indeed, it would hardly have been in jeopardy if he had actually debated in the first debate. We knew that he would be as populist as he needed to be in order to win. Even with 23 million people still unemployed or underemployed (as Romney repeated endlessly), it's not that hard to convince a lot of working-class voters that Romney and his party don't have their interests at heart – if you are willing to make the kind of economic populist appeal that Obama ultimately made.

The downside risk, for a candidate, is the potential loss of rich campaign contributors and media; but Obama was willing to take these risks in order to win. This was a historic difference from previous presidential campaigns: Democratic candidates such as Michael Dukakis and Al Gore flirted briefly with economic populist appeals, but backed off in the face of media pressure.

The media are a huge factor in most elections in the US, and outside of Fox News and the rightwing press, most of the major news outlets were more sympathetic to Obama than to Romney. They still helped Romney quite a bit, however, especially with swing voters, with poor reporting on key economic issues. Most Americans didn't know that the federal stimulus had created an estimated 3m jobs; in fact, they didn't even distinguish the stimulus from the unpopular federal bank bailout. They didn't understand the benefits that people would derive from Obama's healthcare legislation. They didn't know that they'd had their taxes cut under Obama. And millions believed the hype that federal deficit spending and the US public debt were major problems. (For the record, the US currently pays less than 1% of GDP in net interest annually on the federal debt – less than it has paid during the past 60 years.)

The confusion on economic issues was probably the most important influence on swing voters, who supported Romney against their own economic interests, thinking that the economy might improve if he were elected. For this, and other misunderstandings, we can thank the major media, although we should also include the public relations blunders made by the Obama team. Perhaps the biggest strategic error was President Obama's refusal to go after Romney's proposal to cut social security, thereby losing the majority of senior citizens' votes (a big vote in swing states like Virginia and Florida), which he could potentially have won by defending America's most popular anti-poverty program.

Obama's silence on social security is a bad omen for the future of his second administration, when – facing almost immediately the "fiscal cliff" – political, media, and business leaders will be pressing for a "grand bargain" on budget issues that will screw the vast majority of Americans. It will take a lot of grassroots pressure to prevent the worst outcomes: likewise, to get us out of Afghanistan and to prevent another disastrous war, this time with Iran. Obama's foreign policy has been mostly atrocious and the never-ending "war on terror" continues to expand, while most Americans' living standards have been declining.

It's going to be an uphill fight for progress, but it could have been a lot worse.