During his campaign and the early part of his administration, Barack Obama offered a theory about the disorders of the greater Middle East. One explanation, he argued, was the intervention in Iraq, which “fans anti-American sentiment among Muslims, increases the pool of potential terrorist recruits.” Another was the failed Arab-Israeli peace process, which his administration would finally give some emphasis (as though other presidents had not really tried). Obama would refocus the war on terrorism more narrowly on Afghanistan and al-Qaeda and dispense with the Bush Doctrine, which sought to “impose democracy with the barrel of a gun.”

The president’s June 4, 2009, speech in Cairo summarized this critique, while adding an element of soaring ambition. With American combat troops still on the ground, Obama dismissed Iraq as a “war of choice.” He catalogued various criticisms of U.S. policy during the Cold War and the Bush administration — if not an apology, then certainly an aggressive distancing. And he offered an antidote to anti-Americanism: himself. He had, after all, “known Islam on three continents” and had “heard the call of the azaan at the break of dawn and at the fall of dusk.”

It was to be a “new beginning between the United States and Muslims around the world, one based on mutual interest and mutual respect” — implying that insufficient American respect had been part of the problem. Obama’s persona would be the bridge between civilizations.

After pumping up expectations to the size of a Thanksgiving Day parade balloon, the deflation has not been dignified. Large historical challenges do not yield to changes in tone and personality. And the matters that obsess liberal foreign-policy experts — Iraq, the Arab-Israeli peace process, various policies in the war on terror — have little relation to the current chaos in North Africa and the Middle East.

This is a region of dysfunctional societies, run into the ground by corrupt and oppressive autocrats. Leaders such as Hosni Mubarak undermined legitimate opposition, forced dissent into the radical mosque, produced economic misery and vast unemployment, and drew attention away from their failures by blaming outsiders and feeding conspiracy theories. It is hard to imagine a political system better designed to produce resentment, radicalism and riots with minimal provocation.

The collapse of the old order has released dangerous forces, exploited by sophisticated and unappeasable Islamist groups. But preserving the status quo ante was not an option — as though Mubarak or his unimpressive son could have survived indefinitely if only provided with a few more truncheons. The autocrats fell because they failed. For many years to come, the United States will deal with the resulting disorder — attempting to preempt threats and promote more reasonable political actors. The stakes are high and the levers are limited.

Obama’s grand ambitions were naive. But how has he reacted to realities that resisted resetting?

On security matters, Obama is hard to fault, and hard to distinguish from his predecessor. Threats to the U.S. homeland are magnified by terrorist safe havens — places to gather, plot and train. Terrorists in Pakistan, Yemen and elsewhere have been given every reason to feel unsafe by American drones and Special Operations forces. For the most part, Obama has continued to treat the global war on terror as an actual war, not primarily a law enforcement operation.

On aid to democratic transitions, Obama’s record is mixed. In a May 19, 2011, policy address, the sworn opponent of the Bush Doctrine proclaimed “tyrants will fail” and declared the promotion of democratic reform a “core” American interest. Efforts in Tunisia and Libya have been relatively strong. Reaction to the Egyptian government’s persecution of pro-democracy organizations has been limp. The promotion of reform in the Gulf States — where political transition won’t be delayed forever — is weak.

The largest failure of Obama’s approach to the Middle East is its apparent geopolitical randomness. Support for Iran’s Green Revolution was late and grudging — as though courageous reformers were intruding on Obama’s engagement of the regime. The president dramatically escalated the Afghan war before conveying an impression of heading for the exits. After wringing its hands, the administration took needed action in Libya. After wringing its hands, it has remained on the sidelines in Syria. The main consistency has been the wringing part.

In the absence of an organizing principle, flexibility becomes ambiguity. Other nations know exactly what Iran is after, what Russia is after, what Israel is after. They are left to guess at American intentions. The risk is that they will cease to care.