With an oil producing nation, the UAE, hosting the UN’s annual climate summit, debate will naturally turn to the future of fossil fuels. The leaders gathered should know that the question isn’t whether the era of fossil fuels will end, it is when and how. For the sake of the climate, that era must end quickly, but for the sake of societies around the world, it must also end in a managed and orderly way.

Fossil fuels are a doomed technology. While they still dominate the energy landscape, sometime in the coming decades they will die. They will die not because we will run out of coal, oil, or gas—there are enough proven reserves to warm the planet to a catastrophic 4-6ºC. Nor will they die because of pressures to act on climate change, although that will help accelerate their demise. Instead, they will die for the same reason horses and buggies, telegraphs, and typewriters died—by technology replacement.

For the past decades, clean energy technologies, most notably solar, wind, and batteries, have been on an exponential improvement journey with costs plummeting and performance rising. Research by our group at Oxford shows that these improvements have followed a learning curve known as Wright’s Law, named after Theodore Wright who observed exponential drops in the costs of WWII bombers as more were produced. While not quite as rapid as the Wright’s Law improvements seen in semiconductors, computers, and gene sequencing, the clean energy cost declines are just as game changing.

In contrast, our team’s work has also shown that fossil fuels, like many other commodities, do not follow such improvement curves. Their costs gyrate over time, but there is no long-term trend. Technology improvements in those sectors tend to open up new sources of supply (e.g., offshore oil, arctic oil, fracking) as old sources run out, but not translate into lower costs for energy users. Coal, oil, and gas, adjusted for inflation, cost roughly the same today as they did 100 years ago. In contrast, solar costs have declined 10 times over just the past 2 decades.

In a growing number of applications, clean energy plus storage is not just cheaper than fossil fuels, it is the cheapest energy in human history. There are many barriers to the clean energy revolution, such as the need for grid expansion, electric vehicle charging points, critical minerals, permitting issues, and innovations required in sectors such as cement and aviation. But then again, when automobiles first started appearing, there were barriers too—hardly any paved roads, no filling stations nor mechanics, and not much of an oil industry to fuel them. That didn’t save the horses. Cars were simply a better technology, and economics and convenience won out.

Clean energy technologies will eventually win out too. Fossil fuels may still be needed in the future (at least for a while) for plastic and chemical feedstocks and for some limited industrial applications. But it will be a far smaller industry. And the economics of capturing and storing emissions from fossil fuels (CCS) simply can’t compete with renewables, again limiting the future of fossil fuels to niche applications.

While inevitable, this transition is not happening fast enough to save us from ecological disaster. Recent work from our colleagues estimates that in order to meet the Paris goal of limiting warming to 1.5ºC, coal companies would need to cease production by 2027, oil by 2040, and gas by 2046. So policy is needed to accelerate clean energy adoption, drive costs down further, and remove the barriers to deployment. The U.S.’s Inflation Reduction Act was a major step in the right direction, but much more needs to be done across the world.

As we accelerate clean energy adoption we also need to accelerate and manage the fossil fuel wind-down. We know from history that such technology transitions rarely happen smoothly. Instead adoption follows an S-shaped curve, where progress is slow at the beginning and then suddenly takes off before saturating and levelling off. We are still early in that take-off point for clean energy. But when new technologies take-off, old incumbent companies tend to collapse just as fast. The big companies of the whale oil, telegraph, typewriter, land line, and photographic film industries all thought they’d be around forever too.

But while these were major industries in their time, fossil fuels are of another order of magnitude bigger and their collapse will be vastly more consequential. While the clean energy transition will save the world trillions in energy costs and create millions of new jobs, as well as limit climate damage, a disorderly collapse of fossil fuels will also create displaced workers, economically depressed regions, financial market panics, sovereign debt crises, currency crises, government budget crises, geopolitical crises, and even potentially the collapse of some states, or even wars.

It is essential that leaders in government, business, and finance get ahead of this inevitable transition and manage it. Clear, firm deadlines set by governments for the phase-out of fossil fuels will force companies, investors, and nations to begin planning for and adapting to a post-fossil world now. It will also allow time to help and prepare those most negatively affected, from displaced workers, to regions in need of new investment, to developing countries dependent on fossil revenues.

The worst thing governments can do is keep fossil fuels on life support with subsidies and other state aid—it will only delay the inevitable, wasting money on a dying industry that instead should be spent investing in the clean energy future and helping people transition to it. Continued support for fossil fuels gives us the worst of all worlds—they will still collapse eventually, but it will be too late for the planet, and too disorderly for society.

It is time for leaders to recognize that we are in the midst of a historic energy technology revolution, embrace it, accelerate it, and manage it.

Eric Beinhocker is the Executive Director of the Institute for New Economic Thinking, University of Oxford.

Doyne Farmer is the Director of the Complexity Economics Programme at the Institute for New Economic Thinking, Oxford.