Why are gasoline prices more expensive in both Chicago and Los Angeles than in New York City?

According to this graph that I compared the cities above on GasBuddy.com, the average gallon of gasoline in NYC since roughly the start of 2024 has been much much lower than that of Los Angeles and even Chicago. It just surprises me considering that since NYC is known for being on average much more expensive than both cities and considering how it is much more walkable than the two (and figuring there could be less production of gasoline), that it would have the lowest gas prices. I'm just curious as to why this is, Is it because the city or state taxes gasoline less than the other cities?

Edit: I am not from NYC (only both visited and drove through the city multiple times on road trips), I was just comparing cities, then noticed this fact and my curiosity was peaking.