The higher the octane, the hotter it burns. You oil works best at moderate temperatures. Use the lowest octane that you car will run on withour pre-ignition.
My wife put 87 octane in my car a few weeks ago and I had to run my tank down to empty and add octane booster to make the pinging go away.I don't know if it was the gas or if my car runs better on 89 octane which is what I always use.
Technically, higher octane means that the gas burns more slowly. If the piston stroke is long and slow, high octane is good because it keeps the oxidation and therefore the expansion going through the entire piston stroke. If one uses a lower octane gasoline, the gas may finish burning and be finished expanding before the piston has completed its stroke. On the other hand, if the piston stroke is faster, then higher octane only means that unburnt gasoline will be exhausted from the chamber during the normal cycle.