Recently we have seen oil prices fluctuating a lot as compared to the past because of demand and supply issues that control the pricing of the commodity. If we apply demand and supply models which we have learned in microeconomics, we see that both demand and supply are responsible for price fluctuation. We know that oil is being imported from Arab countries, mainly from Saudi Arabia, Kuwait, and Iraq. Why the oil prices were increased in the past? War and ongoing tension in the middle east are culpable for the increase in crude oil prices which automatically surged the prices of gasoline (refined oil).
The uncertainty prevailing there, especially with Iran who is also one of the major oil-producing countries, supply decrease which shifts the supply curve towards the left side of the graph, intercepting the demand curve at a new equilibrium level where the price is high than before. Another factor for the price hike is the fast-growing economies that have a huge consumption of oil. They are China and India whose GDP has been growing above 5% annually. These two emerging economic powers have a huge consumption of oil because of the industrial growth in these respective countries.
The two factors described above have in one way shifted the supply curve and on the other hand shifted the demand curve which increased the price of gasoline. Another issue that is pertinent to mention is the retail pricing which also affects the pricing. It includes marketing costs, refinery costs, distributions costs and taxes. This is the reason why we see that at some pumps, rates vary because they have different vendors to buy oil from who charge them according to their own terms.