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

Now those oil producers have had enough. On Wednesday in Vienna, the Organization of the Petroleum Exporting Countries reached a deal to cut their oil production by 1.2 million barrels per day in order to raise global prices. (OPEC is a cartel of 13 major oil exporters, including Saudi Arabia, Iran, and Iraq, accounting for one-third of global output.)

OPEC nations currently produce 33.7 million barrels of oil per day, total. Under the deal, they’ll bring that down to 32.5 million barrels per day, with Saudi Arabia, Iraq, UAE, and Kuwait making the biggest cuts. Earlier in the week, the talks nearly deadlocked as Saudi officials tried to convince Iraq and Iran to reduce production — both countries have been trying to increase oil output of late as they emerge from war and sanctions, respectively. But in the end, they reached a compromise.

Global oil prices have surged 15 percent since the announcement, with Brent crude rising from $46 per barrel up to $53.77 per barrel by Thursday afternoon. That said, prices remain far lower than they were back in 2014, before the market crashed:

Now, there’s a lot that’s still uncertain about this deal — and prices could easily sink again in the coming months. First, the agreement depends on non-OPEC countries like Russia also agreeing to cut production, which may not happen. Second, some OPEC countries could end up cheating on their quotas — that’s happened before. Third, there’s the question of what happens next in the United States. Over the past year, with prices low, many fracking companies in North Dakota and Texas have idled their rigs. If prices now rebound, those companies could start drilling again, supplying more crude and driving the market back down.

As always with oil, the stakes are high. The price of crude matters for everything from what drivers pay at the pump to the trajectory of the global economy. OPEC, it would appear, still has the power to make world markets shudder.

Why OPEC is trying to cut back on oil production — after doing nothing for two years

For the past two years, as oil prices have been plummeting 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 when prices first began sliding, because officials were hoping the resulting price crash would drive large swaths of the US fracking industry — with its higher production costs — out of business. The fracking boom in places like North Dakota and Texas, after all, was a big reason the oil market was oversupplied.

“At the time, that decision to let oil prices drop made sense,” explains Jason Bordoff, founding director of Columbia University’s Center on Global Energy Policy. Saudi Arabia didn’t want to cut back on production and lose market share only to see other producers reap the benefits — a “historic error” the country made when prices fell in the early 1980s.

But the world has changed a lot over the past two years. US production has fallen from 9.6 million barrels per day down to 8.6 million barrels per day amid the price crash. Nearly $1 trillion in oil investment worldwide has dried up. Iran returned to the oil market after EU and US sanctions were lifted as part of the nuclear deal. Meanwhile, Saudi Arabia has been hurt badly by the price crash. The country has already burned through more than $100 billion worth of foreign exchange reserves and has been forced to cut social services and government salaries to compensate for lower oil revenues, threatening stability in the kingdom.

So the Saudis finally decided to shift their stance. Back in September, OPEC’s 14 members agreed to set a short-term ceiling on their overall output between 32.5 million and 33 million barrels per day. The hope was that OPEC countries could boost prices and ease the pain on their budgets without immediately triggering a massive surge in new oil investment that would lead to another glut and crash.

The details of OPEC’s deal to cut production

That brings us to Wednesday’s meeting in Vienna. OPEC's members have agreed to an overall cut of 1.2 million barrels per day — with the cuts divvied up among members like so:

Saudi Arabia will cut about 486,000 barrels per day by reducing output to 10.06 million bpd. Iran plans to freeze output at close to current levels of 3.797 million barrels per day. Kuwait, UAE, Iraq, and Venezuela will also cut production. Libya and Nigeria will be exempted, as their output has been hurt by unrest and violence.

The deal also hinges on non-OPEC countries contributing an additional 600,000 barrels per day worth of cuts, with about half of that coming from Russia. While Russian officials have tentatively said they’re on board, this is still a point of uncertainty.

A deal like this is never easy to reach. Every OPEC country is in a slightly different situation with different interests, says Jim Krane of Rice University's Center for Energy Studies. Saudi Arabia doesn’t want to go it alone on cuts and lose too much market share. Iran is trying to attract new investment to rebuild its sanctions-ravaged industry and is worried that too steep a cut might scare off investors. Iraq argued it needs oil revenue to fight off ISIS.

So OPEC constantly faces a big coordination problem. All of its members would benefit from higher global prices, but every individual country would rather that someone else make the actual cuts.

Meanwhile, even if OPEC's members agree to detailed production cuts, there’s still the risk that countries could cheat and fail to follow through. “That’s something we’ve absolutely seen in the past,” says Bordoff. Analysts will be paying particular attention to whether Iraq follows through, since its leaders grumbled mightily about accepting cuts in the run-up to the meeting.

The US fracking boom makes OPEC’s decision much more complicated

Even if this deal is successful, however, OPEC faces another, more serious 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 projects need relatively high prices to make investing worthwhile. That crimp in investment has helped stabilize prices around their current level.

But if OPEC successfully throttles back on production and hikes prices, that could induce some fracking companies in Texas or North Dakota 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 tricky part is that no one knows exactly how this dynamic would play out. Bordoff notes that forecasts vary wildly on how much US oil production could grow again if prices rise to, say, $60 per barrel — some analysts suggest an extra 300,000 barrels per day, others 900,000 barrels per day. “It’s a big uncertainty range,” he says.

Part of this is uncertainty about the “break even” point for many projects in the United States — the price at which it’s profitable to drill. During the price crash, many fracking companies managed to slash costs, but it’s often unclear how much of that was due to sustainable efficiency improvements and how much was due to unsustainable moves like squeezing suppliers or focusing only on the most productive wells (which they can’t do forever).

“The uncertainty about US shale is a huge game changer for OPEC,” Bordoff says. “If prices rise to $60, and a large volume of oil can come back quickly, that’s a very significant constraint on the ability of OPEC to manage the oil market that we haven’t seen before.”

The popular view of OPEC is that its members can sway the global oil market with a single utterance. We saw this in 2008, when prices were plummeting amid the financial crisis and OPEC stepped in to halt the slide. But OPEC doesn’t have the same power it used to. 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 and its allies are now trying to reassert its grip.

Further reading

— This piece by Derek Brower gets into the details of the OPEC negotiations and looks at what comes next. As noted above, the question of whether Russia will follow through on its cuts is a huge one.

— Why crude oil prices are always so tough to predict

— Here’s an in-depth look from earlier this year on why global oil prices have been falling ever since 2014.