A sign displays gas prices at a gas station on May 10, 2022 in San Mateo County, California.Liu Guanguan | China News Service | Getty ImagesThe surge in gasoline prices is impossible to miss and at the top of consumers’ minds as large billboards announce that gas now costs $4, or $5, and even above $6 a gallon in some places.With prices at record highs, Americans are feeling the impact at the pump immediately. But higher fuel prices are a headwind for the wider economy too, beyond just consumers having less spending money. Rising fuel costs — especially diesel — means that anything transported on a truck, train or ship is affected. Energy costs are a major contributor to the decades-high inflation numbers showing up as prices for all manner of goods and services march higher.”Energy, in a way, is the tail wagging the dog here,” Bob McNally, president at Rapidan Energy Group, said Wednesday on CNBC’s “Power Lunch.” “Diesel is really the economic fuel. It’s the lifeblood of the economy, transportation, power in some cases…so it really is embedded in economic activity and it’s filtered through so many goods and services.”Why are fuel prices so high?The surge in gasoline prices is thanks, in large part, to the jump in oil prices. Russia’s invasion of Ukraine is the latest catalyst to push crude higher, but prices were already on the move ahead of the war.Even before Covid, energy producers cut back on investment and less profitable projects under pressure from low prices and institutional shareholders demanding higher returns.Then producers slashed output further during the throes of the pandemic, when the need for petroleum products fell off a cliff. People weren’t going anywhere and businesses were shuttered, so far less fuel was needed. Demand dropped so suddenly that West Texas Intermediate crude, the U.S. oil benchmark, briefly traded in negative territory. Economies have since reopened, manufacturing has revived, and people are driving and flying again. This led to a surge in demand, and an increasingly tight oil market beginning last fall. In November, President Joe Biden tapped the Strategic Petroleum Reserve in a coordinated effort with other nations, including India and Japan, in an effort to calm prices. But the relief was short lived.Russia’s subsequent invasion of Ukraine at the end of February sent an already fragile energy market reeling.U.S. oil shot to the highest level since 2008 on March 7, topping $130 per barrel. Russia is the largest oil and products exporter in the world, and the European Union relies on it for natural gas. While the U.S., Canada and others banned Russian oil imports shortly after the invasion, the European Union said it couldn’t without detrimental consequences.Now, the bloc is trying to hammer out a sixth round of sanctions against Russia that includes oil, although Hungary is among those pushing back. Oil has since retreated from its post-invasion highs, but still remains firmly above $100. To put that number in context, at the beginning of 2022 a barrel of crude fetched $75, while this time last year prices were closer to $63.The rapid rise in oil and therefore fuel costs is causing a headache for the Biden administration, which has called on producers to pump more. On the one hand, oil companies are reluctant to drill after pledging capital discipline to shareholders. On the other, executives say that even if they wanted to pump more they simply can’t. They’re facing the same issues that are playing out across the economy, including labor shortages and rising prices for parts and raw materials like sand, which is key to fracking production.Oil prices make up more than half of the ultimate cost for a gallon of gasoline, but it’s not the sole factor. Taxes, distribution and refining costs also influence prices. Constrained refining capacity is beginning to play a larger role. Refining is the key step that turns crude oil into the petroleum products consumers and businesses use daily. How many barrels of oil refiners can process has fallen since the pandemic, especially in the northeast.Meanwhile, petroleum product exports from Russia are being hit by sanctions, leaving Europe looking for alternate suppliers. Refiners are running nearly at full capacity, and diesel cracks spreads — the difference between refiners’ cost of oil and the price at which they sell their products — are now at record levels. All of these are pushing gas prices higher. The national average for a gallon of gas hit a record $4.589 on Thursday, according to AAA, up from $3.043 at this time last year. The numbers are not adjusted for inflation.Every state is now averaging more than $4 per gallon for the first time on record, while California’s statewide average is now above $6.Diesel prices are rocketing higher too. Retail diesel prices hit an all-time high of $5.577 a gallon on Wednesday, up 76% over the past year.All told, households are now shelling out $5,000 per year on gasoline, according to Yardeni Research, up up from $2,800 a year ago, the firm said.How are fuel prices affecting companies?Wide-scale demand destruction from higher gas prices might not have set in yet, but the impacts of surging fuel costs are filtering throughout the economy. Higher prices at the pump mean less spending money in consumers’ pocket. It also means expanding costs for companies, some or all of which will later be passed along to consumers.Target is one of the companies grappling with higher costs. Shares of the store chain cratered 25% on Wednesday – the single worst day since 1987 – following Target’s earnings results, during which it warned about inflationary pressures.”We did not anticipate the rapid shifts we’ve seen over the last 60 days. We did not anticipate that transportation and freight costs would soar the way they have as fuel prices have risen to all-time highs,” Target CEO Brian Cornell said Wednesday on the company’s quarterly earnings call.He told CNBC that higher fuel and diesel costs will be a roughly $1 billion incremental cost during the fiscal year and a “significant increase that [Target] didn’t anticipate.”Executives from Walmart made similar comments. “[F]uel costs accelerated during the quarter faster than we were able to pass them through, creating a timing issue,” Walmart president and CEO Doug McMillon said Tuesday during the retailer’s first-quarter earnings call. “Fuel ran over $160 million higher for the quarter in the U.S. than we forecasted.” McMillon added that over the course of the quarter the company made “progress matching pricing to the increased costs.”Tractor Supply executives noted that domestic and import freight costs have increased “substantially” over the last year, and they expect those trends to persist throughout 2022.”The cost to ship an overseas container has more than doubled compared to pre-pandemic rates, and the cost of fuel is approximately one and a half times higher than it was even a year ago,” Amazon noted during its quarterly update. Monster Beverage executives said the company experienced “significant increases in the cost of sales relative to the comparative 2021 first quarter primarily due to increased freight rates and fuel costs.”The airline industry is also feeling the impact as jet fuel prices – especially on the East Coast – surge. Southwest Air noted that it saw a “significant rise in market jet fuel prices” over the last quarter, while United CEO Scott Kirby told CNBC that if today’s jet fuel prices hold it will cost the airline $10 billion more than in 2019.Bob Biesterfeld, CEO at C.H. Robinson, summed it up this way: “The challenge that sits in front of us, however, is really the rising and record cost of diesel fuel which has such a huge impact on overall freight pricing,” he said Wednesday on CNBC’s “Closing Bell.”To put the surge in context, he said that a carrier will now have to pay close to $1,000 more than last year in fuel costs to move a shipment from Los Angeles to the East Coast.”That’s a real pressure on inflationary costs,” he said.Is there any relief in sight?Looking ahead experts say that demand destruction, or the level at which high prices influence consumer behavior, could be the only thing to quell rising gasoline.John Kilduff, partner at Again Capital, said a $5 national average is in the cards for the busy driving season between Memorial Day weekend and the Fourth of July. “It appears [the national average] needs to go higher,” he said Wednesday on CNBC’s “Squawk on the Street.” “Last week we saw gasoline demand shoot up to what is typically summertime-type levels…there’s more upside here,” he said.Kilduff pointed to two key factors fueling demand despite high prices: pent up demand after the pandemic, and a strong labor market, which means that people will pay what they have to to get to their job.On the other hand Andy Lipow, president of Lipow Oil Associates, said he believes the national average will peak between $4.60 and $4.65.He noted that the sell-off in stocks has dragged gasoline futures lower, which could lead to some temporary reprieve for consumers at the pump.But petroleum is also used in a lot of consumer products, including plastic, which means even if gas prices temporarily cool, costs across the economy could remain elevated if oil stays high.Rapidan’s McNally said at this point it will take a recession to get a handle on product inflation. “It’s not a happy forecast. But [gas prices] just have to go higher, because there is no sign yet of real demand capitulation…they will go higher until that happens,” he said.