The OPEC global oil cartel decided two years ago to put a big chunk of the U.S. shale oil industry out of business.

If you launch a price war, though, you better be sure you can succeed. Otherwise you will go through a lot of financial pain only to find yourself in the situation OPEC does today, with the U.S. shale oil industry not only still alive but actually a leaner and far tougher competitor than ever.

All OPEC managed to accomplish, in western North Dakota and elsewhere in the U.S. shale oil market, is ridding the industry of its most unlucky and reckless producers.

The price war was kicked off by OPEC at the insistence of one of its most powerful members, Saudi Arabia, making a case that the surging American upstarts were taking too much market share and needed to be beaten back. The business was certainly thriving here, as oil production from the Lower 48 states in the 10 years up through 2014 had more than doubled, with production from the Bakken region of North Dakota about tripling.

The OPEC members also knew that it’s the highest-cost producers that are first to die in a price war, and conventional oil producers like Saudi Arabia had a big cost advantage. It’s a challenge to close the cost gap for the American shale producers, too. Conventional oil production is a little like sticking a straw into a juice box, while producing oil from shale rock like the Bakken and Three Forks layers in North Dakota is more like trying to drink from a straw stuck into a sponge.

Oil prices were already sliding in the second half of 2014, but OPEC’s aggressive strategy sure didn’t help. By January 2015 the popular U.S. benchmark price had declined to less than half of the $107 per barrel seen the previous summer. Instead of quickly recovering, the price slid further, dipping below $30 per barrel earlier this year.

Survival becomes the first order of business for companies caught in a downturn so steep and sudden. By the end of 2015, about 13 months after OPEC decided to let oil prices roll off the table, more than three dozen oil companies had filed for bankruptcy protection, many of them upstarts that had borrowed heavily to finance their expansions.

Even well-capitalized — and more cautious — players slashed their capital spending and looked to sell assets to lighten their debt loads. It wasn’t long before opportunistic vulture investors started combing through the industry to scoop up assets at fire-sale prices.

Operators hoping to stay in business were open to any idea to save money. In talking with industry analysts in the past week, they pointed out that new processes and equipment that led to cost reductions since 2014 were coming anyway, but the sense of urgency brought on by the brutal industry downturn accelerated their adoption.

“There were a lot of key elements to it, but the most [effective] has probably been the advent of pad drilling,” said industry veteran Monte Besler, of FRACN8R Consulting of Williston, N.D. “They are no longer moving the rigs, which is a very expensive operation.”

It’s obviously cheaper for the operator to be able to drill wells that are located right next to each other. The oil fields are cut up into legally defined “spacing units” to make it easier to fairly divide the rewards from oil production among the landowners. A spacing unit is typically a rectangle 2 miles long and 1 mile wide, but the drilling operations on the surface will take place in just a small portion of that expanse.

If the same operator controls an adjoining spacing unit, it’s even more efficient if drilling can just step across the line at the south end of the other.

Step is the right term, too, as it’s also now common for drillers to use rigs that can “walk,” inching along on hydraulic legs to a new spot to start drilling. A typical drilling rig from not that long ago needed to be taken down, moved to the next location and then reassembled.

Other savings came from the realization that crews didn’t need to finish drilling a well before starting on another one, as it’s more efficient to drill all the shallow segments around the property first, eliminating the need to keep changing pipe sizes for the deeper segments.

The improvement in efficiency added up to a lot more than a dollar here or a dollar there. It now takes about 14 days for Whiting Petroleum, a big operator in the Williston basin, to drill a well and move on to the next one.

That’s down from closer to 40 days back in early 2012. The operators have gotten a lot more efficient when putting a well into production, too.

Some cost savings may not be permanent, as oil services companies and other suppliers with too much capacity reduced their prices as the industry slumped. Those costs can be expected to increase again when the industry ramps back up, the global energy consulting firm Rystad Energy noted. Yet from 2014 to this year, as Rystad has calculated, the oil price at which a Bakken field well could break even plunged from $60 to $31 per barrel.

“For the core stuff I’ve heard numbers as low as $20 or $25,” Besler said, by core meaning the most productive wells in the heart of the Williston basin. “You get on the edge of the basin where they were drilling during the boom and the break-even is $70 or $80. They’re not drilling there, obviously.”

After peaking in late 2014, North Dakota’s daily oil production declined until it finally slipped below 1 million barrels per day this past August. In October, and even though the benchmark U.S. oil price still didn’t average $50 per barrel, North Dakota’s daily oil production inched back up to more than 1 million barrels.

That’s pretty impressive — for an industry that was supposed to have been dead.