To hear Saudi leaders tell it, the primary threat to the kingdom’s stability is the Islamic Republic of Iran. Worried over Washington and Tehran’s slowly improving relationship, Riyadh has projected an increasingly militarized and sectarian foreign policy aimed at countering Iran’s alleged hegemonic aims in the Middle East.

Yet tension with Iran is only one element of an increasingly complicated mosaic of threats to Saudi Arabia. In fact, the gravest dangers to the kingdom come from within.

Saudi Arabia is a classic rentier state. In exchange for the absolute acquiescence of its 29 million subjects, the ruling al-Saud family provides services such as housing, health care, education, and a variety of subsidies  all funded by the country’s substantial oil wealth. Combined with intolerance for dissent, control over these resources has historically served as the ruling family’s hedge against instability of all varieties.

In 2011, for example, the Saudi leadership responded to the Arab Spring revolts across the region by injecting $130 billion in the form of salary increases, public-sector job creation, and housing subsidies to minimize the potential for an uprising. Meanwhile, the kingdom’s appalling human rights record has deteriorated. Over the past four years, beheadings have skyrocketed and torture has flourished.

However, this authoritarian rentier state model is unsustainable. Oil revenues are down, local unrest is simmering, and extremists are taking aim at the kingdom from without and within. The roots of all these problems come not from Iran but from inside Saudi Arabia itself.

Feeling the Pinch

The global slide in oil prices has taken a toll on Saudi Arabia’s fossil-fueled economy. Foreign reserves dropped by $36 billion this spring, and are projected to fall another $300 billion within two years. The kingdom’s 2015 budget deficit  the first in seven years  is projected to reach $40 billion. With the kingdom waging a costly military campaign in Yemen, and the recently installed King Salman granting salary bonuses to public employees and military families, Saudi Arabia’s coffers are being drained at a rapid pace.

Demographic realities exacerbate these fiscal pressures. Unlike many Arab states that have declining or stable birth rates, Saudi Arabia’s population is growing. More half of the kingdom’s population is under the age of 25 and two-thirds are under 29. With a high youth unemployment rate and an estimated 25 percent of Saudis living in poverty, the economic grievances that drove Arabs in Egypt, Libya, Tunisia, and Syria to revolt could spark similar forms of resistance among Saudi Arabians, constituting a major worry for the royal family.

The kingdom’s educational system is in dire need of reform. While many young Saudis are well-versed in the Koran as a result of their religious education, they often lack skills that are more practical and applicable to the global economy. The human capital of the country’s women is especially underdeveloped. Sixty percent of Saudis enrolled in higher education are women, yet the country’s female unemployment rate is 32.5 percent.

King Salman’s predecessor, King Abdullah, pursued progressive reforms (by Saudi Arabian standards) on gender issues, but the kingdom’s conservative elements prevented much progress. The reality is that Saudi law still recognizes women as property of their male relatives. In Saudi Arabia, which remains the only country that bans female drivers, if a woman falls in public it’s even illegal for an ambulance to pick her up.

Militant Jihadism

Since the 18th century, the Saudi ruling family has relied on an alliance with the ultra-conservative Wahhabi sect of Sunni Islam. Yet Saudi Arabia’s leadership has increasingly found this arrangement problematic, with several Wahhabi militant groups accusing the ruling al-Saud family of corruption and dedicating themselves to overthrowing it.

Scores of jihadist terrorist attacks in the kingdom, which peaked during the al-Qaeda insurgency of the mid-2000s, highlight the failure of Saudi Arabia’s rulers to maintain the loyalty of certain Wahhabi hardliners. Even as Saudi Arabia contributes to the U.S.-led military campaign against Daesh  another name for the self-styled “Islamic State”  thousands of Saudis have fled the kingdom to join Daesh’s ranks on the Iraqi and Syrian battlefields. Meanwhile, its supporters have launched a spate of “lone wolf” attacks against foreigners and Shiites in the kingdom.

The caliphate’s leaders have openly targeted Saudi Arabia’s leadership. In a statement last November, Daesh leader Abu Bakr al-Baghdadi announced his intention to expand Daesh to the “lands of al-Haramein”  a reference to Mecca and Medina. He referred to the ruling family as “the serpent’s head” and the “stronghold of the disease,” likening them to the pre-Islamic pagan rulers of Mecca and calling on supporters in the kingdom to rise up against them.

A few months later, when King Abdullah died, the group’s supporters took to social media to celebrate the death of the “thief of the two holy mosques,” further demonstrating Daesh’s vitriol for the monarchy.

Although Riyadh has made combatting Daesh a lower priority than fighting Houthi rebels in Yemen, the kingdom is extremely vulnerable to the group and its quest to foment chaos in the Gulf region. Given Daesh’s rapid rise to power in large portions of Iraq and Syria, and the mushrooming of its affiliated groups from Libya to Pakistan, Riyadh has every reason to be concerned about implications for the kingdom’s security.

Rising Sectarian Temperatures

Ever since the Wahhabi conquest of the Arabian Peninsula, the Shiites of modern-day Saudi Arabia  roughly 15 percent of the total population  have endured state-sponsored discrimination, social marginalization, and campaigns of violence waged by anti-Shiite hardliners.

Particularly since the Arab Spring, Saudi Arabia’s Eastern Province  home to virtually the entire Shiite minority and all of the kingdom’s oil reserves  has experienced growing sectarian unrest and heightened political tension. In response to increasingly vocal demands for political, economic, and social reforms from their Shiite subjects, Saudi authorities have waged a harsh crackdown in the Eastern Province, maintaining that Shiite dissent is a product of Iranian meddling.

Saudi Arabia’s actions in neighboring countries have further raised sectarian temperatures. Riyadh’s decision in 2011 to deploy security forces to neighboring Bahrain to help the Sunni rulers in Manama suppress a democratic revolt from Bahraini Shiites intensified tensions between Saudi Arabia’s Sunni rulers and their own Shiite subjects. Furthermore, while Saudi Arabia’s conservative religious establishment has called Riyadh’s military campaign in Yemen a “holy war,” Shiites in the Eastern Province have vocally condemned the kingdom’s war against the Houthis. In early April, clashes erupted in Awamiyah between security forces and Shiite protestors demanding an end to Saudi Arabia’s campaign in Yemen.

Last year, Sheik Nimr al-Nimr  a revered Shiite cleric in the Eastern Province  was sentenced to death for allegedly inciting violence against the kingdom. Saudi Arabian Shiites see his sentence as a political maneuver aimed at quelling dissent in the Eastern Province. If Nimr is actually executed, sectarian tensions in the kingdom, as well as in other Middle Eastern countries, can only rise. Documented attacks against security forces by armed Shiite factions in the Eastern Province represent a growing potential for militancy and violent unrest.

Some hardline Wahhabis complain that Saudi authorities are too soft on Shiite dissent. Daesh has exploited this tension by demanding that Gulf Arab backers of the group carry out violence directed at all Shiites of the Arabian Peninsula. Daesh claimed responsibility for two suicide bombings targeting Shiite mosques in the Eastern Province this May, following a shooting of Shiites in the district of al-Ahsa on November 3, which marked the Shiite holy day of Ashura.

The threat of more Daesh-orchestrated and inspired terrorism in the Eastern Province poses a difficult dilemma for Saudi Arabia’s leadership. Following May’s violence, Crown Prince Mohammed bin Nayef bin Abdulaziz al-Saud immediately visited the Eastern Province in an effort to convince locals that their rulers are committed to the security of all Saudi Arabians. However, many Shiites hold the kingdom’s religious establishment responsible for the attacks and maintain that officials in Riyadh turn a blind eye to Daesh’s sectarian agenda in the kingdom.

Ultimately, it will be difficult for Riyadh to maintain a lid on Shiite dissent while Daesh openly inflames sectarian tensions. Daesh’s recent suicide bombing at a Shiite mosque in Kuwait City, which killed 27 and injured 227, along with its calls for violence against Bahrain’s Shiites, underscores its commitment to exploiting the Gulf’s sectarian tensions as a means of spreading its violent campaign to the region’s monarchies  with Saudi Arabia being the group’s top prize.

This balancing act is further complicated by Saudi Arabia’s efforts to topple the Iranian-backed regime in Syria and the kingdom’s ongoing war against the Zaydi Shiite Houthis in Yemen, which will continue to fuel tension between Saudi Arabia’s Sunni leadership and Shiite subjects.

While the Saudi government relies on its petro-wealth to buy loyalty and crush all dissent, a plethora of domestic and regional developments make the need for genuine and serious reforms in the kingdom increasingly urgent. Failure to implement them can only result in the deepening of these grievances.

The prospects for political and social stability in the kingdom will depend on the new leadership’s ability to address these internal issues in a truly meaningful way. Changes in Saudi Arabia’s reactionary society and political system cannot be expected in a short period of time. But they won’t get underway at all until Saudi leaders stop blaming Iran for their problems and start looking within.

Giorgio Cafiero is the Founder of Gulf State Analytics. Daniel Wagner is the CEO of Country Risk Solutions. Reprinted with permission from Foreign Policy In Focus.