Many onlookers in Thailand breathed a sigh of relief on Friday as the Constitutional Court ruled that the country's constitution could be amended by the ruling political party, but not rewritten.

The judges opined that upholding politicians' right to petition for constitutional changes would not endanger the country's monarchy, according to a Thai newspaper, the Nation, The ruling struck a note of compromise, at once protecting the royal family and preventing the potentially disastrous dissolution of Thailand's most popular political party.

This was a complex case, and it represented only one episode in a long struggle between two opposing camps in Thailand's political arena.

The story began in 1998, when a charismatic and wealthy businessman named Thaksin Shinawatra went into politics. He founded a party that would go through many incarnations and eventually become today's ruling party, Pheu Thai.

Thaksin became prime minister in 2001. He was a populist campaigner who made a habit of criticizing Thailand's powerful urban elite, endearing himself to poor citizens and rural dwellers with promises of a more egalitarian society.

But a series of coups, backed by elites and carried out by the military, plagued Thaksin's time in office. He was ousted for the last time in 2006. The following year, a new constitution was implemented by the military following a public referendum.

After that, Thaksin was accused of corruption and eventually indicted. He fled the country in 2008 and has been living in exile ever since.

The still-popular former prime minister continues to play a major role in Thai politics, even though he is forced to make his public appearances on video instead of in person. Some say he still rules by proxy, since his sister Yingluck Shinawatra now runs the country as prime minister and leader of the Pheu Thai party.

Yingluck and her allies swept the elections conducted last year, and she presides over a Parliament with a solid Pheu Thai majority.

The recent court case reflects Pheu Thai members' dissatisfaction with the military's 2007 constitution. Party members sought to amend the document to lessen the authority of the military and the associated monarchy, insisting on a greater share of power for elected officials.

A Finely Calibrated Move By The Constitutional Court

A strong court rebuff could have meant the dissolution of Pheu Thai, which would have almost certainly led to public protests. Instead, Friday's decision held that it was legal for Pheu Thai to amend the constitution, but not to dispose of it entirely.

Still, the battle between the friends and the enemies of the Shinawatra siblings rages on -- those who oppose them are generally allied with Thailand's monarchy and the ailing King Bhumibol Adulyadej.

As Thai citizens become increasingly involved in their country's political processes, the very presence of a dynastically appointed king -- he still retains ultimate power -- begins to look more and more anachronistic.

King Bhumibol is the longest-serving monarch on earth, and he may very well be the richest. In 2010, Forbes estimated he was worth more than $30 billion, although this figure was contested by some courtiers who said the money belongs to the monarchy rather than to the king himself.

This speculation has not helped the monarchy's reputation, spelling trouble for a dynasty that may fall apart upon the death of King Bhumibol, who is 84. On Friday, he recovered from a medical problem involving bleeding in the outer membrane of his brain -- but this was only the latest in a spate of illnesses. He has taken up residence in a Bangkok hospital since being treated for lung inflammation there in 2009, according to the Associated Press.

There are worries about his successor. According to protocol, that would be his eldest son, Crown Prince Maha Vajiralongkorn. But the prince is unpopular with several high-ranking officials, and there are constitutional allowances for King Bhumibol to choose someone else instead. Princess Maha Chakri Sirindhorn is a possible alternative, and she seems to have the backing of the Thai military.

For a monarchy that is already on shaky political ground, a less-than-smooth transition could prove fatal for the dynastic system.

The ruling family's situation is especially precarious due to increased social mobility that has allowed more of Thailand's population to access educations and gain a sense of political efficacy. In that context, the monarchy's blatant disregard for democratic ideals is turning into a liability. Citizens can still get arrested for criticizing royalty and are obliged to employ self-abasing obsequiousness in any reference to the king.

The court ruling on Friday was masterfully delicate: It preserved the monarchy while also giving Pheu Thai inroads to chip away at its power. You could call it a win-win; you could also call it a lose-lose.

In the end, what it means is that the endemic political power struggles in Thailand are likely to keep on going, just as they have been. The next major shake-up will likely occur upon the death of the world's longest-reigning monarch -- at that point, it will be seen whether the dynasty stays on course or stumbles, possibly giving Thailand's ruling party the chance live up to its populist ambitions.