Saudi Arabia's feud with Iran over the beheading of a prominent Shiite cleric led to a lot of overwrought speculation about Sunni-Shiite tensions rising to tear up the Middle East. Those more steeped in regional affairs point to the other 46 men beheaded, almost all of whom were Sunnis charged with terrorism.

The theory here is that the execution of the preacher, Nimr al-Nimr, was less about provoking Shiites than pre-empting domestic outrage over the deaths of so many Sunnis, who make up 85 percent of the country's population. The kingdom has rarely been concerned with domestic opinion in its 90 years of statehood. Does Saudi Arabia now fear unrest among the masses? Should it?

Outside of North Korea and the New England Patriots, few institutions are more opaque than the Saudi royal court. But over the last year, the first in the reign of 80-year-old King Salman, the famously hidebound monarchy has undergone a shocking and risky makeover.

Salman, who took over last Jan. 23 on the death of his half-brother King Abdullah, was widely expected to be just a caretaker. Instead, he took care of business. Within months, he replaced the anointed crown prince with his nephew Mohammed bin Nayef, the longtime interior minister. Yet he also watered down this new heir's influence by dismantling the crown prince's previously independent court.

The real winner was the king's young son, Defense Minister Mohammed bin Salman, who became deputy crown prince and gatekeeper to those seeking the king's attention. The prince was named head of the new Council of Economic and Development Affairs, which took over many powers of the finance ministry, and was given control over Saudi Aramco, the state-owned oil monopoly. (On Thursday, he suggested that the kingdom may consider selling a stake in the oil giant.)

Many questioned whether the untested Mohammed bin Salman, who is thought to be in his early 30s, was up to all that responsibility. Open letters printed in the Guardian attributed to a "senior Saudi prince" accused King Salman of being "completely reliant on his son's rule" and hinted that the oldest generation of royals should choose a replacement for Salman.

Mohammed bin Salman's tenure has not put those doubts to rest. He was the prime agitator for the Saudi intervention in neighboring Yemen, where Iran-backed Houthi rebels had overturned the Saudi-backed government. A nine-month bombing campaign has reduced much of the impoverished country to rubble and killed hundreds of civilians, but the military quagmire just grows deeper. It certainly does not demonstrate a mastery of geopolitics.

There were also reports, unverified but widely believed in the Arab world, that road closings for the deputy crown prince's motorcade were partially responsible for the stampede among Muslim pilgrims near Mecca in September, in which more than 2,000 died. Even if the prince was blameless, and even if road closings were not a factor, the rumors cut deeply into one of the family's greatest sources of legitimacy: as dependable custodians of the Islam's most revered sites.

The Saudi reaction to 2015's collapse in oil prices is also under scrutiny. Saudi Aramco has refused to cut back production -- no doubt wary of the huge losses in market share it suffered by following that path in the 1980s -- leading to huge deficits and staggeringly high unemployment rates among younger citizens. As David Fickling of Bloomberg Gadfly points out, the Saudi economy is now more exposed to cratering oil prices than archrival Iran's.

Facing this budget crunch, the young prince did what you might expect from a modern monarch: He called in the consultants. With advice from McKinsey & Co., Mohammed bin Salman has outlined a plan that will impose taxes and cut billions in electricity, gasoline and water subsidies, particularly among the wealthiest. The government has begun issuing sovereign bonds, its first since 2007, rather than further draw down its $635 billion in reserves. Some state-controlled functions, such as airports, will be privatized.

Above all, the plan calls for diversifying the economy away from oil, which provides 80 percent of budget revenue. The imported number crunchers say a "productivity- and investment-led transformation" could add 6 million jobs by 2030. Sure. Mohammed bin Salman wasn't alive to see all of them, but there have been at least 10 previous official development plans for the kingdom since 1970, and each has put economic diversification at the top of the agenda.

Perhaps 11th time will be the charm. Maybe the Saudis and their Gulf allies can forge a truce in Yemen that lasts more than a couple of days. Perhaps rising Sunni rivals such as Qatar, which notably did not break off diplomatic relations with Iran this week, can be brought into line at the emergency meeting of the Gulf Cooperation Council scheduled for Saturday.

But none of this will ease the royal family's existential fears, or its horror over the Arab Spring of 2011. Particularly chilling was fall of Egyptian dictator Hosni Mubarak, abandoned by his longtime U.S. allies.

The House of Saud has long kept the populace in line by spreading out oil riches, what the scholar Toby Craig Jones calls "the very social contract that informally binds ruler and ruled." Now, a population of which a large majority is under 30 will be the first in memory to face economic privation. It may want a greater say in its future.

"Part of the leverage the regime has had on their people is that they don't impose taxes and therefore people don't expect representation," said Robert Jordan, a former U.S. ambassador to Riyadh. "But once they pay taxes, you're likely to see an increase in political unrest."

The kingdom is taking no chances. It has initiated a new security law that lists "disrupting public order," "risking national unity" and "harming the reputation" of the royal family as terrorist acts. Human rights lawyer Waleed al-Khair was given 10 years in prison for "inflaming public opinion," and a pro-democracy blogger, Raif Badawi, was given the same term as well as 1,000 lashes.

While this week's mass execution was the largest since the 1980s, use of the death penalty overall has been on the rise. In recent years, drug offenses have been far and away the top reason for capital punishment. The first-place ranking for 2016 changed on Saturday, when each of the 47 beheaded had been convicted on terrorism charges. (Adultery, apostasy and "sorcery" also all remain punishable by death. )

If those executions were meant to stifle dissent, it wasn't entirely successful. Since Saturday, there have been a series of protests in the Shiite-majority Qatif region, near the kingdom's vital oil fields, with reports of shots fired and a Saudi Aramco bus torched. The bombing of two mosques there last May, for which Islamic State took credit, was a warning that the region's Sunni-Shiite conflict, which the Saudis have done nothing to assuage, could do great damage inside the kingdom.

Domestic worries also provide an explanation for continuing the fruitless campaign in Yemen. The border between the two nations exists more in theory than practice, and the last thing the Saudis want is for the Houthi rebellion to spread among the Sunni tribes that straddle the line. We saw a similar dynamic during the Arab Spring, when unrest among the Shiite majority in neighboring Bahrain during became such a threat that Saudi tanks rolled across the causeway to prop up the island nation's Sunni leaders.

Saudi Arabia is hardly fertile ground for revolution, even now. It remains among the most oppressive nations on earth. Even under straitened circumstances, its citizens remain among the wealthiest in the world, with a per capita gross domestic product 12 times that of Yemen. Fewer than a million of the nation's 28 million citizens turned out to vote in last month's municipal elections, even though women were on the ballot for the first time.

That said, there is little doubt that the new king and his son face challenges at home that were of little concern to their predecessors. Iran makes a useful bogeyman, but at the moment Sunni extremism in the form of Islamic State is a far more potent threat to Mideast stability than Persian/Shiite ambitions. And while the al-Sauds can blame the American perfidy and Muslim Brotherhood treachery for the collapse of Mubarak's Egypt, they are surely aware that the prime cause of the Arab Spring was economic frustration among a youthful populace with little faith that aging dictatorships would look to the future.

This column does not necessarily reflect the opinion of the editorial board or Bloomberg LP and its owners.

To continue reading this article you must be a Bloomberg Professional Service Subscriber.