Two years ago, global oil prices plummeted as the world started pumping out far more crude than anyone needed. That price crash, from $100 barrel down to $40 per barrel, completely upended the global economy — and cost oil producers like Saudi Arabia billions of dollars in lost revenue.

Now those oil producers have had enough. On Wednesday, the Organization of the Petroleum Exporting Countries (OPEC) announced an agreement to cut back on output in an attempt to lift global prices back up. (OPEC is a cartel of 27 oil producers, including Saudi Arabia, Iran, and Iraq, but not the United States.)

To be clear, OPEC hasn’t actually implemented the cuts yet. That's a far more difficult — and not at all guaranteed — step that still needs to be hashed out in a subsequent meeting in November. But just the fact that OPEC agreed in principle to cuts, the first time it's done so since prices fell during the financial crisis in 2008, was a notable step.

Immediately after Wednesday’s announcement, global crude oil prices jumped 6 percent, to around $48 per barrel:

But in the hours since, many investors have become much more skeptical that this deal will actually hold. In fact, there’s a very good chance that OPEC will simply fail to throttle back on output.

Why OPEC wants to cut back on oil production

For the past two years, as prices have been falling worldwide, OPEC has mostly stood by and watched, unable to reach a decision on how to react.

The cartel's most important member, Saudi Arabia, famously refused to cut output in 2014, because officials were hoping the resulting price crash would drive large swathes of the US fracking industry — with its higher production costs — out of business. (The fracking boom in North Dakota and Texas has been a big reason the market is oversupplied.)

But US drillers surprised everyone by finding ways to reduce their costs and limit their losses. (US output has only dipped to about 8.5 million barrels per day, compared with 9.1 million bpd last September.) As a result, global prices have stayed low.

So Saudi Arabia is finally balking in this game of chicken. Low prices are blowing a hole through its budget and scaring away investors. Saudi Arabia has already burned through $150 billion of foreign exchange reserves. It can't let this madness go on forever.

And that brings us to Wednesday’s deal. OPEC has agreed to set a ceiling on oil output somewhere between 32.5 million and 33 million barrels per day — down from current levels of 33.5 million barrels per day. If those cuts were actually implemented, Iraq, UAE, and Saudi Arabia would likely have to take the biggest hits, according to an analysis from Deutsche Bank:

But there’s a very good chance OPEC will fail to cut output

That said, it’s not clear these cuts will materialize. OPEC's members have only agreed to a broad ceiling. They haven’t made the truly difficult decisions of precisely who will cut, when the cuts will go into effect, how long the cuts will last, or how compliance will be enforced. OPEC is meeting in November to hash out these details, and the deal could easily founder on those rocky shoals.

What’s more, even if OPEC's members agree to detailed production cuts, the country could always cheat and fail to reduce output in practice. That has certainly happened before, and it’s why many observers are skeptical that output will actually fall.

OPEC faces one hell of a coordination problem. All of its members would benefit from higher global prices, because that would mean more revenue for their budgets. But no individual country wants to be the one to cut output — because it would then lose market share and revenue. Iran, Libya, and Nigeria are all trying to increase output right now as they recover from sanctions or conflict. They’d all prefer if someone else cut.

OPEC also faces another quandary. Over the past two years, the fall in oil prices has put a damper on project investment in places like the United States and Canada and Brazil, because fracking and oil sands and deepwater companies need a certain price to make investing in costly new projects worthwhile. That crimp in investment has helped stabilize prices around their current level.

But if OPEC successfully scales back production and hikes prices, that could induce some companies in Texas or North Dakota or Alberta to start drilling again. At that point, supply would rise and prices would fall. OPEC would be right back where it started — except it would have lost market share.

The popular view of OPEC is that its members control the global oil market. But that’s not exactly true anymore. Over the past two years, the cartel has been paralyzed by indecision, watching as US shale drillers flood the market and swing global prices. Saudi Arabia is now trying to reassert its grip. But it doesn't have the same power it used to.

Background: Why oil prices have plummeted since 2014

If you need a refresher on why oil prices have been crashing these past two years, you should study the chart below from the International Energy Agency's Oil Market Report. Since mid-2014, the world has been pumping out far more oil than anyone needs:

Oil supply (in green) remains much higher than demand (yellow) — about 1 million barrels per day higher — with the excess getting saved for later in stockpiles (blue). And, the IEA said in January, that glut is currently expected to persist for the rest of 2016, keeping prices low: "Unless something changes, the oil market could drown in over-supply."

So how did this happen?

Go back a few years before that. Between 2010 and 2014, oil prices were soaring around the world, as demand rose after the financial crisis but global production was struggling to keep up. Many older oil fields were stagnating. Conflicts in places like Libya and Iraq were restricting supply. Countries had to draw down their stockpiles, and prices soared to around $100 per barrel. It seemed like oil would be expensive forever.

Those high prices, however, spurred drillers in the United States to use innovative hydraulic fracturing and horizontal drilling techniques to unlock vast quantities of oil from shale formations in places like North Dakota and Texas. It's hard to overstate the impact of the fracking boom: US crude oil production has nearly doubled since 2010.

Eventually, supply caught up with demand — and then surpassed it. That's when the crash came.

By mid-2014, global demand was starting to slow down. Europe was still reeling from the eurozone mess. China's economy was starting to stumble. But the United States continued to produce more and more oil. Iraq and Libya were also starting to bring more production back online. So prices began sliding, down to $70 per barrel.

At that point, many people expected Saudi Arabia and other oil producers in OPEC to cut back on their own production to prop up prices, as they have in the past. (Conventional wisdom had held that Saudi Arabia needed $100 per barrel oil to balance its budget.)

Surprisingly, that didn't happen. Saudi Arabia decided to increase production in order to maintain its market share, hoping that the subsequent fall in oil prices would crush US frackers, who require higher prices to stay profitable.

And that's when things got really interesting.

Ever since Saudi Arabia's decision to maintain output in late 2014, prices have kept tumbling and tumbling — to $50 per barrel, then $40, then $30 for a bit — largely because supply has remained strong and demand has been weaker than expected.

US drillers turned out to be far more adaptable to low oil prices than the Saudis thought, as companies cut costs and boosted productivity in order to keep the oil flowing. (US production has finally stopped growing over the past few months, but the decline has been far less severe than originally predicted.) Iraq has nearly doubled production since 2014 — to more than 4 million barrels per day — as it recovers from conflict. Thanks to the nuclear deal with the US, Iran has started exporting more oil this year as sanctions are lifted.

In the meantime, major developing economies like China, Russia, and Brazil remain mired in a slump, putting a damper on oil consumption. An unusually mild winter last year helped suppress demand for heating oil. And a stronger dollar means that some countries now have to pay more for crude imports, which further limits consumption.

That's the basic story. As long as supply far outstrips demand, oil prices will stay relatively low.

Cratering prices are having all sorts of ripple effects around the world. Car owners in places like the United States, Europe, and Japan are suddenly paying way less for gasoline, which means they have more money to spend on other things. (Arguably, low prices have helped bolster the US economy over the past year.) SUVs and gas guzzlers are coming back in style.

On the flip side, crude producers like Saudi Arabia, Russia, and Venezuela are struggling to balance their budgets and suffering from a major revenue crunch. Oil companies in the United States and elsewhere are watching profits evaporate. Banks that financed the US shale boom are reeling from a wave of defaults. Developing nations that previously relied on petrodollars for financing are now hurting. It's a major disruption.

At this point, no one really knows what will happen next (or if they do, they’re making bets in the markets rather than writing articles). Maybe OPEC can successfully engineer a sustained price hike. Or maybe US oil production will rise again and drive prices down. Or maybe China’s economy will recover and pick up prices. It all comes down to supply and demand. They’re famously hard to predict.

Further reading: Why crude oil prices keep taking us by surprise