How is the price of gas determined?

Several things play into the price you see at the pump, including supply and demand, crude oil prices, the cost of refining crude, taxes, and the local market.

The retail margin varies according to the size of the town or city. In the gasoline market, prices in large cities are generally lower than in small towns. Because gas stations located in urban areas often have greater volume than stations in smaller towns, their retail margin is often lower.

Natural Resources Canada explores this question in greater detail.