> An octane rating, or octane number, is a standard measure of a fuel's ability to withstand compression in an internal combustion engine without causing engine knocking. The higher the octane number, the more compression the fuel can withstand before detonating. Octane rating does not relate directly to the power output or the energy content of the fuel per unit mass or volume, but simply indicates the resistance to detonating under pressure without a spark.
from https://en.m.wikipedia.org/wiki/Octane_rating
It just lets higher performance cars achieve higher compression ratios. I believe technically this means it has a little bit less raw combustion potential the higher the octane rating. But none of this actually matters in practice as long as you feed your car what it asks for.