In November 2014, opec ministers gathered in Vienna for a tense meeting. Oil prices had fallen to their lowest point in four years. For decades, the cartel had responded to situations like this by restricting production and sending prices higher.

But things were changing. During the mid- and late aughts, more companies in the United States had begun using an alternative to traditional land-based drilling and deepwater offshore drilling. The method—fracking—involved using a mixture of water, chemicals, and proppant (sand or sand-like substances) to crack underground shale rock and release oil from it.

In 2014, U.S. shale oil represented about 5 percent of the oil being produced worldwide. But the process was expensive, which suggested to many that shale producers could not stay in business if oil prices dipped too far.

The main question at hand for the opec ministers was whether their countries should lower oil production and thereby raise prices. The oil minister of Saudi Arabia, Ali al-Naimi, spoke up. He argued, according to widely reported accounts of the meeting, that if the opec countries stopped pumping as much oil, non-opec producers, such as U.S. frackers, might step in and supply more oil themselves.

Naimi’s argument proved persuasive: opec decided not to reduce production, and the price of oil plunged—from just over $70 a barrel to less than $60 by the end of the year. The move immediately came to be seen as a strike against U.S. frackers. “Inside opec Room, Naimi Declares Price War on U.S. Shale Oil,” announced a Reuters headline the day after the meeting. And in fact, oil prices did appear to be crossing an ominous threshold for frackers: In December 2014, U.S. shale producers needed oil prices to be at $69 a barrel on average in order to break even on a newly drilled well, according to Rystad Energy, a consulting firm. Whether or not this was an explicit price war, many observers believed that U.S. fracking was in trouble.

What’s happened since has been a surprise. Even as oil prices fell and stayed low—by January 2016, they had dropped to less than $30 a barrel; today, they’ve rebounded, but only to about $45—shale-oil companies kept pumping. Their average break-even price has fallen by more than 40 percent, to about $40 a barrel. In some parts of the country, that figure is much lower. In the Bakken shale formation in North Dakota and Montana, where the economics of fracking are particularly favorable, the average break-even price is $29.

Fracking, it turns out, is a remarkably nimble industry—which perhaps, in retrospect, should not have been such a surprise. In the early years of the fracking boom, a Harvard Ph.D. student, Thomas Covert, studied records related to wells fracked in the Bakken shale formation. Wells that were newly tapped in 2005, he found, captured on average only 21 percent of the profits they could have produced if they’d been fracked in the most optimal way—that is, with the best mix of water and sand. By 2012, though, newly fracked wells were capturing 60 percent of maximal profits.

When oil prices fell, frackers responded by continuing to innovate. David Demshur, the CEO of Core Laboratories, a Dutch company that analyzes the ground into which oil companies drill, recalls suddenly getting a lot of phone calls in the summer of 2014 from shale companies desperate to squeeze more oil out of their wells. Demshur’s business with shale companies, until then, had amounted mostly to producing reports on the characteristics of a given chunk of rock; it was up to the companies to make use of the information. Now Core Laboratories started recommending the best cocktail of water, proppant, and any of several chemicals to get the most oil out of a particular well. Some of the biggest shale companies signed up.

Demshur’s experience wasn’t unusual; I heard similar stories as I spoke with analysts and oil-company representatives. Oil companies invested more in technology from outside firms to help them become more efficient and productive at fracking, while also doing their own in-house research. Their techniques varied: using different combinations of water, proppant, and chemicals; applying the cocktail with greater pressure; drilling several wells simultaneously in a single area; using drones and sensors, instead of humans, to detect when equipment needed to be fixed or replaced.

Statoil, which drills in several U.S. shale basins, came up with a concept known as “the perfect well”—essentially, a hypothetical well that could produce oil at the lowest cost possible. “We just went through piece by piece to find more-efficient ways of doing every single operation,” Bruce Tocher, the head of the company’s shale-oil-and-gas research group, told me. In the Eagle Ford shale formation in Texas, Statoil cut the average time it took to drill a new well from 25 days to 15.

One major advantage for shale producers has to do with the time and money it takes to drill a new well for fracking relative to starting an offshore project. Before the fracking boom, the United States—while extracting plenty of oil through conventional drilling on land—depended largely on offshore projects for alternative sources of oil. But fracking wells can be created more quickly and cheaply than offshore sites. “As soon as they see prices go up, they can get a rig together and go drill a well and bring that well online within a matter of weeks,” Judson Jacobs, an energy analyst at the research firm IHS Markit, told me.

Not every oil producer has succeeded in the current climate; more than 100 North American oil and gas companies have gone bankrupt since the beginning of 2015, and U.S. oil production fell by about 6 percent between the 2014 opec meeting and this past summer. That itself was a source of cost savings: Producers focused on the best fields rather than the marginal ones; outside contractors, with less work to go around, cut their rates. Yet much of the story involves innovation, and those producers that survived proved startlingly adept. In early August 2016, David Stover, the CEO of the shale producer Noble Energy, admitted to analysts, “It’s a bit surprising to me how we continue to still see improvements.”

Thanks to all these factors—not to mention the likelihood that Donald Trump’s administration will be quite supportive of fracking—it has become clear that the shale-oil business is going to survive, at least for now. And that could have major implications for the global oil market. Saudi Arabia and the other opec countries have long worked together to cap supply so prices don’t tumble. However, with sustained competition from shale companies, opec is unlikely to be able to keep prices as high as it once could. “Certainly, the days of $120 barrels of oil are a long way away,” Jacobs says.

The consequences of cheap oil will be widespread. Car owners may benefit; the environment will not. Meanwhile, the geopolitical ramifications have already been “enormously significant,” according to Jason Bordoff, a former energy adviser to President Obama who now directs Columbia University’s Center on Global Energy Policy. In Venezuela, low oil prices (combined with other factors) have led to a food shortage. In Nigeria, they are among the causes of an ongoing recession. And Saudi Arabia, which has recently had a hard time balancing its budget, has cut back on public services, such as subsidies for water and electricity.

For its part, the United States is expected to produce more oil over the next several decades—which “puts us in a stronger position to have conversations with countries around the world,” Bordoff says. If a future U.S. president wants to persuade other leaders not to buy oil from a particular nation, for example, it could help that the United States can step in and provide some oil itself.

No one knows how this will all play out over the long term. At some point, U.S. shale basins could run out of oil (though other non-opec countries with shale resources could make up for that). Or alternative energy sources could eventually displace oil altogether. Still, it’s clear that the shale revolution has changed the geopolitics of oil, with ripple effects likely for years to come. Even the leaders of Saudi Arabia seem to be acknowledging this: In April 2016 they released an unprecedented plan to dramatically reduce the country’s economic dependence on oil by encouraging other industries, such as mining and tourism. In May, a year and a half after leading opec into an apparent attack on U.S. fracking, the longtime Saudi oil minister Ali al-Naimi was ousted. And soon after, Saudi Arabia was encouraging opec to cut production and raise prices—exactly what it had argued against not so long ago.