If you've ever driven cross-country you know how much the price of gasoline can vary, ranging from nearly $4.00 in San Francisco to just a hair over $3.00 in Roanoke, Virginia. What's the deal? Give credit to higher taxes, distance from supply, and type of fuel.
The map above comes from The American Petroleum Institute via ExxonMobil so take it with a coastline-cover-in-oil-sized grain of salt, but it's accurate to say that the difference in taxes does play a role as everyone plays the federal rate of 18.4 cents-per-gallon (well, not Tesla drivers), but consumers in California have, for instance, pay 47 cents more per gallon than drivers in Alaska.
But as this map from Gas Buddy (at the top of this post) shows the difference is greater than just the tax difference, so what's up?
Distance From Supply
Retail gasoline prices tend to be higher the farther it is sold from the source of supply: ports, refineries, and pipeline and blending terminals. About 60% of the crude oil processed by U.S. refineries in 2011 was imported, with most transported by ocean tankers. The U.S. Gulf Coast was the source of about 23% of the gasoline produced in the United States in 2011 and the starting point for most major gasoline pipelines, so those States farther from the refineries will most likely have higher prices.
This explains why, for instance, Wyoming is an oil-producing state as they have a huge crude oil pipeline coming from Canada with relatively cheap fuel, although no one tops the Gulf Coast States.
Refining Capacity And Type
California, in particular, uses a different blend of fuel that's "more stringent" than the fuel required by the federal government, and this costs car fans in Sacramento a lot more. Additionally, when refining capacity is stretched (as in California) you end up with higher prices when plants stop running. The same goes for when a hurricane takes aim at Texas.
So, move to Texas and pray for good weather.