Can Egypt Learn From Thailand? BANGKOK was rocked by anti-government demonstrations earlier this month - once a depressingly familiar sight. But that bad news shouldn't overshadow the good. Disruptive protests may have been all too common in Thailand just a short while ago, but in the last two years, they've become an anomaly. The country has gone from a virtual wreck to a booming, and relatively stable, success story. Figuring out how it's managed to do that is important, and not just for Thailand's 65 million citizens. For if a place this polarized can pull itself back from the brink, other bitterly divided societies might be able to as well. To get a sense of how far and fast Thailand has come, consider its recent past. Marketed to tourists as the land of a thousand smiles, Thailand spent most of the last decade fighting with itself. The trouble really began in 2006, when the military, in connivance with royalists and the courts, overthrew the populist prime minister Thaksin Shinawatra. The coup ignited years of running street battles between citizen armies of "yellow shirts" - defenders of the old, semifeudal order - and "red shirts," Thaksin supporters among the rural and urban poor. Political power changed hands four more times in four years. In January 2010, the police responded to enormous red-shirt protests by killing over 90 demonstrators, injuring 2,400 others and jailing hundreds. The economy went into a tailspin. Then, in August 2011, Mr. Thaksin's sister Yingluck Shinawatra became prime minister. And today, barely halfway through her four-year term, Thailand looks like a different country. According to Ruchir Sharma, head of emerging markets at Morgan Stanley, the economic outlook is the brightest in 15 years: the currency is up, land prices have climbed and the stock market has more than quadrupled since 2008. Tourists have returned, and the streets (despite the August flare-ups) are mostly quiet. So how did Ms. Yingluck, initially considered a mere proxy for her exiled brother, do it? The formula turns out to be deceptively simple: provide decent, clean governance, compromise with your enemies and focus on the economy. Ms. Yingluck understood that she'd never accomplish her broader agenda and improve life for the poor unless she could first calm the place down and complete a full term in office. And to do that, she had to give all Thais a stake in her success. So she began a bold economic stimulus and reform campaign. Some of her moves, like a 40 percent minimum-wage hike and subsidies for car buyers, were aimed directly at her lower-class base. But others, such as $67 billion of infrastructure spending and cuts to personal and corporate taxes, have benefited the wealthy as well. She also sought to make peace politically. She has courted opponents, holding respectful meetings with the powerful and popular king - and even with the general allegedly behind the coup against her brother. According to Thitinan Pongsudhirak of Chulalongkorn University, Ms. Yingluck has brought the elites onside by offering a tacit bargain: she preserves their privileges and they let her hold onto power. Thus she has left the military alone, even recently naming herself defense minister so she could ensure that no one would mess with the army's prerogatives. She has avoided challenging the Constitution, including the infamous lèse-majesté laws that ban criticism of the monarchy. She has kept corruption, a perennial problem in Thailand, to a minimum. And she has ensured that her brother, whom the aristocracy still fears and loathes, remains in exile. This, in many ways, is an ugly deal. It means Ms. Yingluck must tolerate undemocratic checks on her power and the repression of free speech. Despite an amnesty law now being debated in Parliament, some of her red-shirt supporters are angry that she hasn't done more for the families of those killed and imprisoned by the military-backed government in 2010. It's also a fragile bargain. Thailand's recovery could easily unravel. Die-hard yellow shirts have pounced on the prime minister's mistakes, like a scheme to boost the price of rice that backfired spectacularly. Other dangers loom: the economy is still too export-dependent, and while everyone is getting wealthier, inequality is growing. Ms. Yingluck hasn't erased Thailand's dividing lines so much as papered them over, and the underlying power struggle could erupt again at any time - especially if her brother returns or if the king, now 85, dies. But the longer Thailand remains at peace, and its economy keeps growing, the greater the odds that real democratic politics will take hold, so that when Thailand does finally confront its divisions, it will do so through ballots, not street battles. Indeed, the flaws in Ms. Yingluck's grand bargain are part of its genius. The fact that everyone is irritated by the truce she's negotiated is a good sign, not a bad one: it means nobody is getting everything he wants. That's how compromise is supposed to work. It may seem messy; it is. But it's the kind of mess that other countries like Egypt or Venezuela or Zimbabwe can only envy right now.