You people have me about to break out my engine design books and start teaching ME-340...(That would be Engine Design at GMI)
IBB is pretty much right on..
RHFP is close.. Depending on the system used to control mixture and intake timing..
There are 2 ways to control detonation that are easily workable, given fixed thermal load/atmospheric conditions and fixed compression ratio and a given fuel. Variable valve timing can affect the effective CR as well, but that is a variable we will leave for later.
Method 1- Retard ignion timing, so that by the time the plug ignites the mixture, the piston will almost be on the way down. What this does it keep the mixture from "detonation" by spontaneous combustion. This is caused when the fuel/air mix reaches a critical pressure. Basically, it gets hot enough to ignite spontaneously. The "rattle/ping" you hear is the two flame fronts colliding in the combustion chamber.
This is bad, because it rips the boundary layer that is keeping the 4000F gases off the piston top, allowing the piston to ablade (think meltng to a vapor).
Retarding timing works only to a point. At some point you have to back off on the load on the engine, or get better fuel.
Method 2-
Richen the mixture..
The first thing this does, it the heat of vaporization helps cool the charge, giving more of a buffer against spontaneous combustion. The other thing it accomplishes, is that the richer mixute is harder to detonate.
This hurts performance, if you go richer than about 13.5:1, you really fall off the backside of the power curve with this.. (for reference, 14.7:1 air/fuel by weight is the stoichiometric mixture, which is the "perfect" mix from a chemistry standpoint)
Also, emissions go through the roof, fuel mileage goes down, and if you go rich enough, it can "wash" the oil off the cylinder walls, causing abnormal wear.