system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What is the difference between the 3 different types of gasoline at a gas station? Is one supposed to be more efficient, and if so, which one is the best value?
gpt
the difference is "Octane", which in simple terms is an additive that makes gas LESS flammable.

You might think that sounds like a bad thing, why would you pay more money for less flammable gas?

Well, the trick to a car engine is getting the gas to burn *precisely* when you want it to.  Which is generally right after the piston hits the top of its rotation.  It does this with a spark plug.

The problem is, engines are hot and violent, and when a bunch of air and gas are highly compressed in such an environment, it may detonate before the engine intended.

In which case that means that the explosion is actually pushing against a piston still trying to travel up.  Not good for an engine...  its often heard as a "knocking" sound (and thus is known as as engine knocking).  Also bad for efficiency and power.

So you can design the engine to have less compression in the cylinder, make the fuel mixture less likely to self ignite, but that produces less power.  So higher end engines instead call for higher octane fuel so they can be sure the gas will not ignite until they say so.

Many modern engines will adjust themselves to tolerate any grade of fuel, producing a bit more power with the "better" fuel.

There is some efficiency to be gained here as well, but it will basically never offset the price premium of the more expensive gas.  If your concerned about cost over power and your car will accept either (check your owners manual) you will be better with regular fuel.