For the past eight decades Saudi Arabia has been careful.

Using its vast oil wealth, it has quietly spread its ultra-conservative brand of Islam throughout the Muslim world, secretly undermined secular regimes in its region and prudently kept to the shadows, while others did the fighting and dying. It was Saudi money that fueled the Mujahedeen in Afghanistan, underwrote Saddam Hussein’s invasion of Iran, and bankrolled Islamic movements and terrorist groups from the Caucuses to Hindu Kush.

Today that circumspect diplomacy is in ruins, and the House of Saud looks more vulnerable than it has since the country was founded in 1926. Unraveling the reasons for the current train wreck is a study in how easily hubris, illusion, and old-fashioned ineptness can trump even bottomless wealth.

The Kingdom’s first stumble was a strategic decision last fall to undermine competitors by upping oil production and, thus, lowering the price.  Their reasoning was that, if the price of a barrel of oil dropped from over $100 to around $80, it would strangle competition from more expensive sources and new technologies, including the U.S. fracking industry, the arctic, and emergent producers like Brazil. That, in turn, would allow Riyadh to reclaim its shrinking share of the energy market.

There was also the added benefit that lower oil prices would damage countries that the Saudis didn’t like: Russia, Venezuela, Ecuador, and Iran.

In one sense it worked. The American fracking industry is scaling back, the exploitation of Canada’s oil sands has slowed, and many arctic drillers closed up shop. And, indeed, countries like Venezuela, Ecuador, and Russia took a serious economic hit. But despite obvious signs, the Saudis failed to anticipate China’s economic slowdown and how that would dampen economic growth in the leading industrial nations. The price of oil went from $115 a barrel in June 2014 to $44 today. Because it is so pure, it costs less than $10 to produce a barrel of Saudi oil.

The Kingdom planned to use its almost $800 billion in financial reserves to ride out the drop in prices, but it figured that oil would not fall below $80 a barrel, and then only for a few months.

According to the Financial Times, in order to balance its budget, Saudi Arabia needs a price of between $95 and $105 a barrel. And while oil prices will likely rise over the next five years, projections are that price per barrel will only reach $65. Saudi debt is on schedule to rise from 6.7 percent of GDP this year to 17.3 percent next year, and its 2015 budget deficit is $130 billion.

Saudi Arabia is spending $10 billion a month in foreign exchange reserves to pay the bills and has been forced to borrow money on the international financial market. Two weeks ago the International Monetary Fund’s (IMF) regional director, Masood Ahmed, warned Riyadh that the country would deplete its financial reserves in five years unless it drastically cut its budget.

But the Kingdom can’t do that.

When the Arab Spring broke out in 2011, the Saudi Arabia headed it off by pumping $130 billion into the economy, raising wages, improving services and providing jobs for its growing population. Saudi Arabia has one of the youngest populations in the Middle East, a lot of it unemployed and much of it poorly educated. Some 25 percent of the population lives in poverty. Money keeps the lid on, but for how long, even with the heavy-handed repression that characterizes Saudi political life?

In March, the Kingdom intervened in Yemen, launching an air war, a naval blockade, and partial ground campaign on the pretense that Iran was behind the civil war, a conclusion not even the Americans agree with.

Again, the Saudis miscalculated, even though one of its major allies, Pakistan, warned Riyadh that it was headed for trouble. In part, the Kingdom’s hubris was fed by the illusion that U.S. support would make it a short war—the Americans are arming the Saudis, supplying them with bombing targets, backing up the naval blockade, and refueling their warplanes in mid-air.

But six months down the line the conflict has turned into a stalemate. The war has killed 5,000 people, including 500 children, flattened cities, and alienated much of the local population. It has also generated a food and medical crisis, as well as creating opportunities for the IS and Al-Qaeda to seize territory in Southern Yemen.  Efforts by the UN to investigate the possibility of war crimes were blocked by Saudi Arabia and the U.S.