With U.S. drivers facing near-daily changes at the pump, the reasons behind what they pay for gasoline are largely set upstream of the corner station, several industry figures said in explaining how the retail price gets built. The jump in fuel costs has been tied to an oil and gas market roiled by the Iran war, which has also contributed to shipping disruptions in the Strait of Hormuz.

In the AAA average, the U.S. average for a gallon of gas topped $4 on Tuesday. The pressure on fuel prices followed a rise in oil markets when U.S. markets opened Thursday after President Donald Trump’s Wednesday speech in which he promised to hit Iran “extremely hard” in the coming weeks, while asking Americans for patience.

Local operators say they often see the volatility first. Lonnie McQuirter, director of operations at 36 Lyn Refuel Station in south Minneapolis, said wholesale fuel prices have been going up, sometimes multiple times a day, and that those changes have been the main reason the station has had to charge more than it did a month earlier. About a mile off Interstate 35, the station’s neighborhood convenience store posted $3.399 a gallon for regular gas on Thursday, about 20 cents lower than the metro average, according to AAA.

McQuirter described a retail business model that depends on what he can buy and what it costs to keep the operation running. “We price based on what we’re able to buy fuel at, and how well we can operate,” he said, declining to speculate about competitors and saying, “They’ve got different economics.” He also pointed to tighter margins, higher credit card fees, and rising costs to maintain pumps, saying the effects fall on families as well as businesses.

Several analysts said the retail sticker price is only partly the station’s decision. The U.S. Energy Information Administration has said roughly half the price at the pump pays for crude oil—the main ingredient in gasoline—with about 20% going to refiners that convert crude into fuel. As crude prices have jumped amid the Iran war and related disruptions, gas retailers have adjusted their pump prices to reflect the higher cost they paid for their next shipment of gasoline.

Taxes and distribution-related costs add to the total as well. The report said taxes—federal, state and local—account for nearly 20% of the price, while about 10% is left for retailers, who still must cover transportation, labor and other expenses. Industry data compiled by the convenience store trade group NACS, citing research firm OPIS, estimates that retailers’ markup averaged about 38 cents a gallon over the past five years, and that after expenses stations may keep roughly 15 cents per gallon, said Jeff Lenard, a vice president at NACS. “Some make more, some make less,” he said.

Explaining why prices can differ from station to station, Patrick De Haan, head of petroleum analysis at GasBuddy, compared gas station owners to homeowners setting a sale price based on a market they cannot control. “If I was selling a house today, I’d be beholden to whatever the housing market is,” De Haan said. “That’s the same for gas station owners. Whatever the price of oil and gasoline are, they are a price taker, not maker.”

De Haan and other figures pointed to taxes as one driver of regional gaps and to competitive dynamics that can affect what drivers see on outdoor signs. California’s gas taxes and fees totaled about 71 cents per gallon last year, versus roughly 9 cents in Alaska, the report said. It also cited factors including how far a location is from refineries, the type of retailer, local fuel-volume levels, and whether alternative fuel options are nearby.

In terms of who benefits when gas prices rise, the report said retailers often do not capture large gains quickly. De Haan said the margins shrink when prices go up because it becomes harder for stations to pass along increases as fast as they receive them at wholesale. The Federal Reserve Bank of Dallas’ Garrett Golding similarly said the effects can also show up in sales inside stations, as squeezed customers may spend less on other items.

For small operators like McQuirter, the tension can play out in day-to-day decisions. He said that in times when consumers feel squeezed, small operators act on emotion more than greed. “We’re in our stores every day looking our customers in the eye,” he said. “It really takes a toll when people are having to cut back on certain things in order to afford to live.”

Even when pump prices move sharply, some profits in the oil and gas supply chain are made upstream, Golding said, and at some point a significant spike can also hurt demand. He added, “It may be a good stretch of days or weeks for them,” referring to companies in the supply chain, “but they’re also cautious of what it could portend.”

Finally, the report noted that prices often drift after sharp increases, including when oil prices start to fall. Golding said retailers may recover some losses if there is uncertainty about future supply costs, while prices can also rocket up and then drift down “like a falling feather.”