It wasn’t supposed to end this way for Democrats.

Eight years ago, Barack Obama won the presidency promising to transform America. A supremely self-confident politician, Mr. Obama was the object of extravagant hopes that he nurtured and encouraged.

After his Super Tuesday primary victories in 2008, Mr. Obama said that the movement he began would “ring out across this land as a hymn that will heal this nation, repair this world, make this time different than all the rest.” He would slow the rise of the oceans, end wars abroad and bridge political divisions at home. For his supporters, Mr. Obama was almost a figure of myth, comparable to Lincoln. When he won the presidency, nothing seemed beyond his reach.

Yet after two terms of the Obama presidency, the Democratic Party is weaker than it has been since the 1920s. Republicans now control the presidency, the Senate, the House and a strong majority of governorships and state legislatures. President Obama’s repeated personal appeals to his supporters to vote for Hillary Clinton in order to preserve his legacy failed to put her over the top. The man who seemed to hold such promise for his party ended up taking a scythe to it.

What happened?

For some of the president’s admirers, the answer is that America has become benighted and bigoted. For others, the culprit is the Republican Party, which obstructed Mr. Obama at every turn. And for still others, like Mr. Obama, the problem is that his administration didn’t do enough to advertise its greatness.

Even if you believe there are elements of truth in these explanations, they still amount to excuses. The same country that twice elected Mr. Obama did not suddenly become a nation of deplorables. In his first two years, with Democrats firmly in control of the House and Senate, Mr. Obama won the passage of his sweeping legislative agenda, including the Affordable Care Act, the stimulus package, financial regulations, the extension of jobless benefits and more. As for selling his policies, President Obama was constantly making his case.

The decimation of the Democratic Party came because Mr. Obama turned out to be great at poetry and bad at prose.

Start with the economy. It’s true that he inherited a wicked recession, that unemployment is much lower than when he entered office and that the stock market has reached an all-time high. On the flip side, the economic recovery has been unusually weak, with annual growth never exceeding 3 percent. (Until Mr. Obama, every president since Herbert Hoover had at least one year of 3 percent growth.) The labor force participation rate is at the lowest it has been since the 1970s. Since 2008, real wages have remained the same or fallen for the bottom four-fifths.

To make matters worse, the Obama presidency has been characterized by injurious incompetence, in particular with regard to his signature achievement, Obamacare. The unveiling of the website was a disaster, and the promises the president made — that Americans could keep their doctors and plans if they chose to — were false. Mr. Obama guaranteed lower insurance costs to families and lower health costs to the taxpayer; instead, costs rose. Several of the state-run exchanges appear to be headed for collapse.

Overseas, the Obama years have been defined by spreading disorder and chaos, particularly in the Middle East and North Africa, with nations collapsing and borders dissolving. More terrorist safe havens have been established than ever before. Russia and China have become more aggressive and significantly increased their geopolitical influence. America is now held in brazen contempt by our enemies and mistrusted by many of our allies.

Yet in some respects the greatest failure of the Obama years is in the area where many people thought he would excel. Mr. Obama made the centerpiece of his 2008 campaign a promise to end a politics that “breeds division and conflict and cynicism.” In February of that year, I praised him for “a message that, at its core, is about unity and hope rather than division and resentment.” Yet he leaves office with America more conflicted and cynical than when he took office. More than 70 percent of Americans say the country is either more divided or no more united than it was in 2009. Race relations are the worst in decades, and our nation is as polarized as it has been in the modern era.

It would be silly to lay all the blame for this at the feet of Mr. Obama. Republicans have been rhetorically reckless at times, and President-elect Donald Trump has coarsened public discourse and set Americans against one another in ways that were once unimaginable. But Mr. Obama came first, and he played a role in where we are.

In his farewell address last week, President Obama said that for the sake of our democracy we need to heed the advice of the fictional character Atticus Finch, who said, “You never really understand a person until you consider things from his point of view.”

Yet Mr. Obama never seemed to consider things from a different point of view from his own. He has shown withering disdain for his opponents, constantly impugning their motives even as he testified to the purity of his own. It was his arrogance that proved to be Mr. Obama’s undoing. (Even leaders of his own party felt Mr. Obama’s derision, as if dealing with them was somehow beneath him.) Mr. Obama dismissed those who disagreed with him like a professor forced to deal with simple-minded, wayward students. He warned us against retreating into our bubbles, but he was never able to escape his own.

During the Obama presidency, many people felt unheard and alienated. They are the kind of Americans Mr. Obama had in mind in 2008 when he talked about “bitter” people clinging to their “guns or religion.”

Barack Obama is among the most talented campaigners we have ever seen. But as president, he failed in a manner and on a scale that damaged his party, undermined faith in the institutions of government and left the nation more riven than he found it. For most Americans, the economy has been listless. All this helped create the conditions that allowed a cynical demagogue to rise up and succeed him, one who will undo the achievements he most prizes.

In many ways Barack Obama and Donald Trump could not be more different. Mr. Obama is equable and graceful; Mr. Trump is erratic and graceless. Yet one cannot make sense of the incoming presidency without understanding the failures of the outgoing one.

Peter Wehner, a senior fellow at the Ethics and Public Policy Center, served in the last three Republican administrations and is a New York Times contributing opinion writer.