The major headline out of Saudi Arabia last month was that the country's big state-owned oil company, Saudi Aramco, bought 70 percent of the country's big state-owned petrochemical company, the Saudi Basic Industries Corporation. ("Sabic," for short.) What's more, they carried out the purchase in U.S. dollars.

Off the top of your head, that might sound weird: What's the point of one government-owned entity buying another? And why use U.S. dollars, as opposed to the riyal, Saudi Arabia's own currency?

The answer, basically, is that Saudi Arabia's economy is addicted to oil, they need to kick the habit, and they need U.S. dollars to do it.

Saudi Arabia sits on some of the biggest oil reserves in the world, and pumps out around 12 percent of the global oil supply. Most all of this is done through that aforementioned state-owned oil company, Saudi Aramco, which is a massive player in the global oil sector. More to the point, the oil sector accounts for roughly 40 percent of Saudi Arabia's domestic economy, and 90 percent of its exports.

The problem with organizing so much of your economy around one industry is that a lot of other domestic industries tend to wither and die. Saudi Arabia has some domestic manufacturing, but a lot of its high-end consumer products are imported: air conditioners, cars, planes, vehicles, equipment, rubber products, furniture, and so forth. More worryingly, the country imports most of its food: at least 80 percent a few years ago, and maybe closer to 90 percent today. The country tried to start a domestic agricultural sector, but those efforts failed to take off. The country's mostly desert, and modern farming practices have quickly decimated Saudi Arabia's precious supply of natural water aquifers. These days, the vast majority of its water consumption is provided by desalination plants.

This all leads us right into the next problem: Saudi Arabia is staring down the barrel of climate change. Assuming the rest of the world gets its act together and cuts its fossil fuel use way down over the next few decades, Saudi Arabia is going to find itself with a whole bunch of oil to sell and no buyers.

Even if that doesn’t happen, climate change is going to make Saudi Arabia itself much hotter, and drive its domestic energy consumption through the roof. Fadhel Kaboub, an associate professor of economics at Denison University and the president of the Global Institute for Sustainable Prosperity, explained to The Week that Saudi Arabia already burns most of its oil for domestic use: cars and transportation and power. "The vast majority of their electricity production is fossil fuels. There's virtually nothing else," Kaboub said. The country is starting to move to some natural gas electrical generation, and has long-term plans for nuclear. In the meantime, it has some of the most energy-inefficient housing stock in the world, it relies on enormous air conditioning consumption, and its desalination needs are a huge power drain.

Long story short, either the rest of the world stops buying Saudi oil, or the Saudis wind up burning all of it themselves anyway. One study projected they'll be net importers of oil by 2038.

This is where the U.S. dollar enters the picture. For a lot of complicated historical reasons, the overwhelming bulk of international trade is done through contracts written in U.S dollars. When Saudi Arabia sells its oil to the rest of the world, it gets paid in dollars. When Saudi Arabia buys food and other necessities from the rest of the world, it pays in dollars. If the exports ever stop, the dollars run out, and the imports stop too.

Saudi Arabia does have a big sovereign wealth fund, worth at least $300 billion. It works as a rainy day fund of U.S. dollars, to keep the imports coming in an emergency. But if the oil exports stop, Saudi Arabia will burn through that backup supply pretty quick. And then it's toast.

To escape this trap, Saudi Arabia needs to diversify its domestic economy and become more self-sufficient: build up its ability to grow its own food, manufacture its own high-end products, and figure out a sustainable energy supply that won't get wiped out by climate change.

The catch is that Saudi Arabia needs U.S. dollars to do these things too, at least for a while. The country needs to eventually reach a place where imports — denominated in dollars or any other foreign currency — aren't crucial to its economy. But getting there will require a lot of equipment and technology and so forth that the country will initially have to import.

This is what finally circles us back to last week's deal. Saudi Aramco took a bunch of U.S. dollars, either from its revenues or from borrowing, and used them to buy out the 70 percent of Sabic that's owned by Saudi Arabia's sovereign wealth fund. That purchase gave the Saudi government an influx of about $70 billion in straight up dollar-denominated cash that it can use to kick off its much-needed domestic economic reform.

You might have heard of the long-running plans to finally offer up shares of Saudi Aramco to be traded on international stock markets. The point of that was also to get Saudi Arabia a big influx of U.S. dollars. That initial public offering may yet happen, but it keeps getting delayed, so eventually the Saudis turned to Aramco-Sabic deal instead.

The only question left is how Saudi Arabia should spend the money.

Kaboub proposes the country use advanced aquaponics to build up its self-sufficiency in food — aquaponics can be done indoors for 10 percent of the water traditional agriculture uses — and switch over to renewable energy. "It's a prime location for wind and solar and geothermal," he noted. Kaboub's also a fan of a universal job guarantee, which he thinks can serve as a staging policy to lower unemployment and build up other domestic industries.

For the moment, though, the Saudi government has a different vision. Their plan focuses somewhat on renewables and diversifying manufacturing, but the big initiative is on moving the economy more into high-end luxury tourism.

At any rate, Saudi Arabia has begun the process of getting off oil. Where the country will eventually land is anyone's guess. What is certain is that Saudi Arabia will need a ton more U.S. dollars to pull off its transformation, and it's only got so much time, and only so many resources, to get them.