What a pathetic old brute Hosni Mubarak has become. Here he is telling ABC that he'd love to give up power, really he would, but he's afraid Egypt would collapse into chaos without his steady hand at the wheel. Meanwhile, the country has been doing a pretty good job of keeping order while Mubarak's state withers away, as neighbors band together to direct traffic, clean the streets, treat the wounded, and protect lives and property. It's Mubarak and his mobs who have been the fountainhead of chaos: Again and again, protesters have captured a looter, a vandal, or a stone-throwing, machete-wielding goon, only to discover he was carrying police ID. If you're looking for violence on the rebels' side, the worst that you can definitively say is that when Mubarak's heavies attacked the demonstrators camped out in Cairo's Tahrir Square, many of the campers fought back. And can you blame them for that?

Nonetheless, Mubarak is posing as the foe of the disorder he did more than anyone else to unleash. He has also sacked some ministers, promised to leave office later in the year, and detained the chief of the secret police. All this as his allies beat and bully reporters and seize or destroy their equipment. It's a disorienting combination of heavy-handed coercion and tentative concessions.

But no matter how many cameras are smashed and campers are shot, the Day of Departure rallies keep swelling and Mubarak keeps making nervous promises of change. The momentum is with the rebellion, not the repression. That's why the president looks so pathetic right now. He's spent decades assembling a potent police state, and still he's losing.

Perhaps that isn't how you expect such events to play out. If you mention the idea of a revolution driven by civil disobedience rather than violence, you're apt to hear the old saw that such revolts only work in countries with good-hearted leaders at the reins, not savage regimes held together by torture and terror. But contrary to the popular stereotype, Gandhian uprisings don't succeed by shaming rulers until they can't bring themselves to crack down. They succeed by delegitimizing authority—by breaking the braces that support the structures of social control, so the rulers can't crack down. Political power is not a pyramid fixed in stone. It's a complex, dynamic ecology of shifting loyalties and allegiances. When those loyalties and allegiances shift swiftly and in sufficient numbers, the result is a revolution.

When you watch Hosni Mubarak's lethal crackdown in Egypt, you're watching a cornered creature lashing out as its options disappear. The man may manage to hold onto power through sheer brutality, but his chances of pulling that off are diminishing each day; time and again, the old thug's tactics have backfired, strengthening rather than diminishing the opposition. The revolutionaries are driving wedges between the president and the forces he has relied on to stay in office. When Mubarak tries to fight back, he only succeeds in shoving the wedges in further.

On a global level, for instance, Mubarak is being pried from his foreign patrons. Egypt is the world's fourth largest recipient of U.S. aid, with only Iraq, Afghanistan, and Israel receiving more money. But in the last week Washington has gradually edged away from its ally in Cairo, as it became more clear that the strongman valued for his ability to impose "stability" is presiding over an increasingly unstable society. No, the Obama administration hasn't endorsed the demonstrations—when Mubarak's brownshirts assaulted the protest in Tahrir Square, Assistant Secretary of State P.J. Crowley responded with a mealy-mouthed request for "all sides" to avoid violence. But the crackdown has deeply damaged Mubarak's relationship with the United States. This isn't the quiet repression that takes place in the country's back alleys and jail cells, the sort of everyday authoritarianism that the American authorities can wink at (or even take advantage of themselves, if there's an "enhanced interrogation" to be done). This repression is loud, it's public, and—now that the president's loyalists are attacking the international press—it's falling on American citizens as well as Egyptians. Even Crowley condemned it. Now the Senate has passed a resolution asking Mubarak to go, and America's diplomats are reportedly pushing for the same thing.

Mubarak had already seen one major act of repression backfire, when his Internet shutdown did far more to injure the Egyptian economy—and to make him look like a tyrant—then it did to stop any movement from mobilizing. With this week's clampdown, he has made it steadily harder for his most powerful global ally to stand by him.

Domestically, meanwhile, there's a wedge between Mubarak and the military. From the first day of the protests, the Egyptian army has presented itself as a neutral party, at one point declaring that the demonstrators' demands are "legitimate" and that it would not use force against the crowds.

Needless to say, that doesn't mean the army joined the uprising. The same troops who refused to shoot the demonstrators also refrained from intervening when the president's supporters assaulted Tahrir Square. And when Mubarak appointed a new government, the grassroots opposition wasn't appeased, but the army brass surely appreciated the ascension of their man Omar Suleiman to the vice presidency. Nonetheless, it's telling that Mubarak has had to rely on undercover cops and mobs-for-hire to do his dirty work. The country's biggest arsenal hasn't been his to command, and the people who do command it have been asserting their independence.

If it were up to Egypt's generals, we'd see a smooth transition to a new strongman—an outcome that probably isn't that far from what Washington wants. And that, minus the smoothness, is what we might ultimately get. But there may be another wedge at work, and it could change the endgame entirely: a wedge detaching the officers from the rank and file.

It doesn't matter what the generals want if ordinary soldiers won't follow their orders, a lesson several dictators and would-be dictators have learned the hard way. Egypt has a conscript army, and many soldiers surely sympathize more with their friends, relatives, and neighbors in the streets than with the men issuing commands. The police are more closely tied to Mubarak's regime, but a similar dynamic is at work in their ranks as well. There have been reports of policemen fraternizing with protesters, removing their uniforms, refusing to fill their assigned social role. The more the momentum turns toward the opposition, the less risk there will be for other cops and soldiers to follow suit.

If you're wondering what will happen after Mubarak falls, this may be the most important wedge to watch. If the revolution ultimately hinges on the generals switching sides, the military that already dominates the government will have the central role in deciding what happens next. That doesn't have to mean the police state will continue. Chile's transition from the Augusto Pinochet dictatorship to democracy and civil liberties happened after the armed forces refused to impose martial law, with one general heroically tearing up an order right in front of the despot. But if the military coopts this revolution, Egypt will likely end up with Suleiman or someone like him as president, a few token reforms, and little else. If the revolution relies on a mutiny in the enforcers' lower ranks, by contrast, the rebellion is much less likely to be reduced to a backdrop for a palace coup.

If there's an iron law of politics, it's that everything can always get worse. But if you want a reason to be optimistic about Egypt, there's this: Unlike a coup, an invasion, or anything involving a vanguard party, a people-power revolution strengthens rather than disrupts civil society. Of all the ways a regime can fall, this is the path that's most likely to lead to a freer country. When it comes to political models, the liberated zone in Tahrir Square beats a barracks any day.

Jesse Walker is managing editor of Reason magazine.