From a very informative article from Factly here

It won’t be exaggeration to say that the Price of Petrol & Diesel affect almost every Indian directly or indirectly. Such is the importance of these two that any increase or decrease in their price is widely discussed. Ever since de-regulation, the prices change every fortnight based on the changes in the price of crude oil and changes in tax rate. While people at large follow pricing of these two commodities, they do not understand the structure of pricing, the components that add up to the final price. The above video is aimed at demystify the Petrol pricing.

The Retail Selling Price (RSP) of Petrol

Retail Selling Price (RSP) of Petrol is determined based on a lot of factors. The average price of Crude Oil of the Indian Basket is calculated every fortnight. This price is calculated in dollars per Barrel. The price in Indian rupees is also dependent on the average exchange price for that fortnight.

Crude Oil to Petrol

The Crude Oil is transported and refined to extract Petrol. The cost & freight charges, refinery charges are added to the price of Crude oil. This is called the Refinery Transfer Price (RTP). In other words, this is the price paid by OMCs (Oil Marketing Companies) like IOCL, BPCL & HPCL to the refineries. OMCs retain some margin and sell it to the Dealer (the owner of the Petrol Pump).

Different Taxes

There are broadly two different taxes, the Central Excise Duty (imposed by the Central Government) and the State VAT (Value Added Tax). These two taxes are added to the Price that is charged to dealers. The current excise duty is Rs 21.48 per litre of petrol. VAT varies from state to state. In Delhi, the VAT percentage is 27%. The dealer commission is also added to the price after imposition of the Central Excise. (tax rates as of 1st Feb, 2016)

All these prices add up to the final Retail Selling Price (RSP) of Petrol that reaches the consumer. There are differences in the price in various states because of the different VAT rate. The price also varies between a pump owned by different OMCs. These minor differences are because of the variations in margins & dealer commission.

This entire process is explained in the above 75 second video.

Here is an Infographic explaining the petrol price breakup starting from the price of crude oil till it reaches to the end consumer including the various components of pricing. Note: The data is as on March 1st, 2015.

Petrol Price Breakdown in India - Infographic