Answer: These taxes are meant to do two things — raise money to pay for infrastructure and reflect some of the environmental costs of driving. Unlike most taxes, gas taxes are charged as a flat charge per liter, rather than as a percentage of the pump price.
Every time you top off your vehicle at the pump, you're paying federal and state gas taxes that are included in the price of every gallon of gasoline. The federal tax, at 18.4 cents per gallon, is meant to help the federal government pay to build and fix things like highways and bridges.