The battle over the Keystone XL pipeline in the United States has always been a fight about Canada's oil sands. Those sands contain vast reservoirs of crude oil, more than enough to cook the planet. So, to constrict development, environmentalists have been trying to block pipelines, like Keystone, that might enable industry expansion.

But increasingly, this whole debate is becoming moot — at least for the foreseeable future. Over the past year, global oil prices have plummeted. And, in response, many companies have been backing away from the oil sands, finding they can't make the economics of new projects work.

The latest casualty is Royal Dutch Shell, which announced on Wednesday that it was canceling its Carmon Creek oil-sands project in Alberta, which would have produced 80,000 barrels of crude per day if developed. The company will take a loss of $2 billion on investments already made and it's writing off 418 million barrels of oil from its proven reserves. This comes after Shell had already shelved plans for its Pierre River oil-sands operation, which would've produced 200,000 barrels per day.

In its statement on Carmon Creek, Shell blamed both low prices and a "lack of infrastructure to move Canadian crude oil to global commodity markets." Green groups have been taking credit for that latter part: In addition to the hold-up on Keystone XL, activists have bogged down a number of other oil-sands pipelines around Canada. So here's a breakdown of what's been going on.

The economics of oil sands are dismal at $45/barrel

Back in the 2000s, when global oil prices were steadily rising, a lot of companies found it profitable to exploit western Canada's oil sands for bitumen, a gooey form of petroleum. It's not an easy task: you either have to dig up the sand with giant excavators and then heat it with hot water and chemicals, or you inject steam deep underground. But as long as oil prices hovered around $100 per barrel, it was all worth it.

Canada currently produces about 4 million barrels of oil per day — roughly 4 percent of the world's supply — with half of that coming from the oil sands. And that was just the beginning: By some counts, there are 167 billion recoverable barrels of oil beneath the surface there. It was a staggering amount of crude, and, potentially, a cataclysmic amount of planet-warming CO2.

So expansion seemed inevitable: Last year, Alberta's Energy Regulator was predicting oil-sands production would more than double, to 4.4 million barrels by 2023, and keep growing thereafter.

But then came the crash. By July 2014, the world was awash in crude supplies, thanks in part to the oil-sands boom but also thanks to the fracking frenzy in the United States. Meanwhile, demand was slipping in places like Europe and China. So... prices tumbled. Today, the price of West Texas Intermediate crude sits at around $45 per barrel.

That makes the economics of oil-sands extraction much dicier. According to ScotiaBank, WTI prices need to be stay above $65 per barrel for a new steam project in Alberta to turn a tidy profit. Others peg the "break-even" price for new oil-sands projects at $80 per barrel. Either way, energy companies aren't confident that prices will rebound to that level anytime soon, so they've been backing away. Firms like Suncor, Cenovus, and Shell Canada have all been downsizing their investments in Alberta.

One important caveat: The price crash mainly affects future projects, but it has less of an impact on existing projects or projects currently under construction. Oil-sands mining requires huge upfront investments, but the projects can operate relatively cheaply once they're up and running. Many existing operations can turn a profit even if prices drop below $45 per barrel. (Indeed, companies like Suncor and Imperial Oil are still aiming to go through with projects that were already half-finished before the crash, a move that will bring an extra 500,000 barrels a day online by 2017.)

So that's where things stand today. Apart from a handful of projects currently under construction, Canada's oil sands industry is going to have a tough time expanding further if prices remain low. But production isn't likely to shrink, either, since most existing operations can keep chugging along.

By the way, Alberta's oil sands aren't the only place where low oil prices are biting hard. Shell recently abandoned its plans to drill for oil and gas in the icy Arctic Ocean, which is costly and dangerous, because the financial rewards didn't justify the hassle. And, yes, these situations could all shift again if global oil prices ever rebound, say, due to surging demand or inadequate supply.

Do Keystone XL or other pipelines still matter?

It appears so. In its statement, Shell didn't just blame low oil prices for the canceled Carmon Creek project. The company also cited a "lack of infrastructure to move Canadian crude oil to global commodity markets."

Once oil gets extracted from the ground, it still needs to be transported to refineries where it can be turned into usable fuel. But the oil sands in Alberta are remote from most refineries. So either the oil has to be piped across the mountains to British Columbia, shipped to Eastern Canada, or brought down to the United States.

The cheapest way to do that is via pipeline, and energy companies have been trying to gain approval for a whole frenzy of different pipelines out of Alberta. Here's a terrific map from Katie Valentine of Think Progress:

Trouble is, many of these pipelines are running into obstacles. The Obama administration would need to approve Keystone XL, and so far they've dithered on doing so, under pressure from environmentalists. The much larger Energy East pipeline has faced heavy opposition in Quebec. And Northern Gateway, which would transport oil to Canada's western coast, has faced steep opposition from First Nations tribes.

That isn't necessarily fatal. Companies can still ship their oil by rail — and many do. But rail is a fair bit more expensive (by one estimate, it costs an extra $6 to $11 per barrel to transport oil to the Gulf Coast by train instead of pipeline), and it's harder to scale up rapidly. So a lack of pipelines can make life more difficult for oil companies, further sullying the economics of new projects.

Ultimately, the global price crash appears to be the most significant factor here: a plunge from $100 per barrel down to $45 is just too steep to ignore. But pipelines still matter.

Further reading: 9 questions about the Keystone XL debate you were too embarrassed to ask