Gas prices are up. Blame OPEC and climate change.

It's hard not to notice that gas prices are climbing, up over 8% from a month ago. Aside from the obvious pain to drivers, higher fuel prices also pose a risk to the economy if they remain elevated long enough to reverse the steady decline in inflation and force the Federal Reserve to pursue additional interest rate hikes.

The price of a gallon of gas is the result of a complex interplay among many factors, most of which have been conspiring against consumers of late. While it might not make it hurt any less, understanding how the gas gets from the well into our tank might at least provide a brief distraction from watching the dollars spin up on the gas pump.

When crude oil was first extracted from the ground in quantity during the mid-19th century, it was processed into kerosene to replace whale oil in lamps. The kerosene production process also generated a waste product that was dubbed "gasolene" (later gasoline) derived from a Greek word for "chaos" or empty space. The adoption of the internal combustion engine by Ransom E. Olds and Henry Ford in the early 20th century created a robust market for this formerly useless byproduct and spawned the modern refining industry.

The price of crude oil accounts for a little less than half of the pump price for a gallon of gas. Crude prices have surged by about 25% over the past six weeks thanks in part to a coordinated effort by the OPEC+ cartel to reduce production and increase revenue. OPEC's market power is substantially diminished from the days of global embargoes but is still relevant at the margin. Thanks to the shale revolution, the U.S. is now the largest oil producer on the planet and extracts 60% more oil and petroleum liquids than Saudi Arabia and double that of Russia, but a 2% cutback in global supply from OPEC is still enough to move prices.

The Biden administration has also curtailed its COVID-19-related releases of government stockpiles from the Strategic Petroleum Reserve, which had exerted some downward pressure on prices. And the war in Ukraine continues to roil global markets as Ukrainian drones recently attacked and disabled two Russian vessels including an oil tanker — a tactic that, if successfully pursued, could further constrict crude supplies.

The next largest cost factor behind oil is refining: the conversion of crude oil into usable products like gasoline, diesel fuel, propane and heating oil. About one fourth of the price at the pump is accounted for by the complex refining process. You can thank climate change for part of the recent price surge.

The basic refining process starts with the distillation of the crude oil, a bit like making Tennessee whiskey. In fact, the core of every refinery is a distillation tower that works like several stills stacked atop one another. Crude oil is heated to its boiling point, around 800-900 degrees, at which point it vaporizes into an oily steam that rises through the tower. As this petroleum vapor ascends it also cools and condenses into several different constituent liquids called fractions, depending on their boiling points. The lightest vapors with the lowest boiling point condense at the top, including LPG (propane and butane), gasoline and a liquid called naphtha. The middle of the tower condenses somewhat the heavier liquids with higher boiling points like kerosene (jet fuel) and diesel, while the heaviest sludge called residuum stays at the bottom. Distillation of crude into its components is therefore also called fractionation.

Additional steps are required before the job is complete. While some gasoline condenses near the top of the tower, most motor fuel is produced by further processing the naphtha or some of the heavier residuum via secondary chemical and thermal processes. The dregs of residuum are also converted into heavy fuel oil, asphalt, lubricants and waxes.

Most refineries are designed to operate safely within a temperature range of 32 to 95 degrees. Half of all U.S. refining facilities are on the Texas or Louisiana gulf coast, which sweltered throughout most of a memorably punishing July which proved to be the hottest month in recorded human history. Such excessive heat requires that operators throttle back or shut down operations, and in fact six major refineries were forced to halt operations for a time during the torrid spell. According to AAA, the heat resulted in the loss of 500,000 barrels per day of output, around 5% of all U.S. refining capacity. These temperature-related capacity constraints were further exacerbated by sporadic heat-related power outages on the already inadequate Texas electrical grid. This is likely to be a recurring theme in future years.

Meanwhile, the onset of the summer driving season prompted increased demand just as gasoline inventories dropped to the lowest level since 2015. July and August are the peak months for road trips, just as refiners are required to switch to more expensive gasoline formulations to reduce emissions.

The good news, such as it is, is that capacity is returning to normal as temperatures subside and gas prices are stabilizing. Tennesseans can also be thankful for small favors. Gas prices are still about 8% lower than a year ago, and the Southeast has some of the lowest prices in the nation. Regular gas in California is north of $5 per gallon. Here's to a mild hurricane season.

Christopher A. Hopkins, a chartered financial analyst, is co-founder of Apogee Wealth Partners in Chattanooga.