First, in spite of it being the wiki,
http://en.wikipedia.org/wiki/Engine_knocking .
Next was gleaned from
http://www.clubwrx.net/forums/showthread.php?t=25686 :
"Causes of Detonation
Trying to isolate a detonation problem in a highly modified or even slightly modified engine requires you to determine if the combustion problem is being caused by a change you made to the engine, is inherent to a design flaw, or is derived from an external cause such as carbon deposits or poor fuel. Obviously the area with the largest variable is the fuel quality. Octane determines a fuel's ability to resist auto-ignition, or in lay terms, its ability to wait for a spark to initiate a flame. For our purposes we will explore knock independently of fuel octane rating.
When knock occurs, there is uncontrolled combustion with multiple flame fronts, with only one of them being initiated by the spark plug. During knock, cylinder pressures experience an extremely rapid rise and spontaneous burning and release of the end gases' energy. It is not uncommon to see a pressure rise of up to 8 bars per degree of crankshaft angle, or up to 50,000 bars per second. Anything that will either increase heat or retain heat in the combustion chamber will promote auto-ignition.
Common problem areas are sharp edges of metal either on the piston or in the combustion chamber. For instance, if the piston has a valve relief cut into it, there is usually a very defined edge that the cutting tool leaves. This sharp edge is greatly prone to super heating and will actually retain enough heat that it will start to glow. If the fuel should hit this glowing edge either prior to the lighting of the spark plug or even after ignition, it is very likely that another flame front will initiate. If this unintended ignition occurs very early in the compression stroke, then the piston will be forced up against the increased pressure of the burning gas and will result in a form of abnormal combustion referred to as preignition. When this happens, the end result, if severe enough, is that the connecting rods bend. Turbocharged engines are specifically prone this. Carbon deposits that build up in the combustion chamber or on the piston top will have the same effect, along with the decreased volume at TDC, which in turn raises the compression ratio.
As stated earlier, anything that will raise temperatures in the cylinder will help promote detonation. This rise in temperature could occur many different ways: very lean air/fuel ratios, heating of the charge air prior to entering the combustion chamber, compression of the air molecules from forced induction, or poor heat dissipation through the cooling system. Increase of cylinder pressure will also prompt detonation. Camshaft profile, compression ratio and quench area all come into play. Design criteria as to combustion chamber shape and mixture motion, spark plug location and piston design can all make an engine more or less inherently prone to abnormal combustion. Naturally, spark timing and fuel quality round off the list."