Engine detonation occurs when the air/fuel mix ignites within the combustion chamber in an uncontrolled manner, instead of by the progressive action of a moving flame front. The terms 'ping' (a light, barely observable detonation) and 'pre-detonation' (detonation caused by the ignition of the charge slightly before the full ignition of the flame front by the spark plug) are also commonly used. 'Knock' is another synonym.
Click for larger image
One definition of knock is "an undesirable mode of combustion that originates spontaneously and sporadically in the engine, producing sharp pressure pulses associated with a vibratory movement of the charge and the characteristic sound from which the phenomenon derives its name". If detonation is allowed to go on for more than few seconds, the very sudden pressure changes within the cylinder can damage the engine. In a worse case scenario, pistons, rings and even the head itself can suffer major damage. Obviously, heavy detonation is something to be avoided! Note also that the higher the specific power output of the engine (ie hp per litre), the greater the likelihood of damage if detonation occurs.
In everyday driving, detonation is most likely to be heard when the driver is using a gear too high for the engine speed and load conditions - like climbing a steep hill with the right foot flat to the floor, while in third gear and travelling at 40 km/h. Depending on the engine, detonation can sound like a 'ting, ting' noise, or even a little like coins rattling in a coin tray. However, in some engines, the audible note is much deeper when heard from the cabin. In turbo/blown cars, or cars where the compression ratio has been substantially increased, detonation can occur at high engine speed and high loads, making it very difficult for the driver to hear it over the general noise level that's present at the time.