Octane is a term used in relation to a specific hydrocarbon chain. Oct=8. Octane resists combustion under compression better than its closest chemical cousin Heptane (which makes up alot of the remaining 13% of 87 octane gas). 87 Octane= 87% C8H18 (octane). Thus an octane rating translates loosely to how much compression fuel/air can take before it combusts. An engine with a high compression ratio needs higher Octane gas so that the gas will hold up to the compression until the spark hits. Diesel fuel has a Cetane rating. Cetane is highly combustable under compression.
If your engine has a compression ratio of 10:1 or less putting anything better than 87 is a waste of money.
The percentage of cleaning agents in pump fuel is very small. It has to be. if it were much higher than it is we would all be having our engine heads done every 100k miles whether we like it or not.
The detergents in gasoline are typically noncombustable matierials and if they are used too often or in too large a quantity they will glaze the exhaust valves, ports, and manifold (and prematurely foul a catalyst) leading to a number of other problems; not the least of which is bad engine performance.
Advancing and retarding the timing on any engine will effect the compression ratio to some degree but will only stop pinging in engines in which the compression ratio is borderline.
Plus (89 octane) is a joke. The Octane rating is an average and many times you will be paying $.10 more a gallon for 87.5 Octane gas. Two points is typically not enough to make much of a difference. Rarely will you see a vehicle that calls for 89.