There is sometimes confusion between detonation and pre-ignition. The two are very different from each other.
Also known as ping or spark knock, detonation takes place after the spark plug has fired and a portion of the air / fuel mixture has been consumed in the normal combustion process. As combustion progresses and octane quality is inadequate, the pressure and temperature in the combustion chamber increase to a point where the remaining unburned mixture is unstable. At that point, the remaining mixture self ignites, creating much higher pressure and temperature than would occur during normal combustion. The sound of detonation occures when the peak cylinder pressure takes place too early in the cycle. This causes vibration in the cylinder walls, resulting in ring seal loss, and excessive piston rock. Detonation can also overload the pistons, rings, wrist pin bushings, and rod bearings. Some engine damage can occur when detonation is mininal, but severe detonation can cause major damage.
This phenomenon is just as its name implies that it takes place before ignition of the air / fuel mixture would normally occur (that is, before the spark plug fires). This condition is caused by a hot spot in the combustion chamber. It could be a piece of carbon, a hot spot on the exhaust valve, or from heat generated in the previous combustion stroke. Pre-Ignition is very likely to be destructive due to the very high cylinder pressure that occurs before the piston has reached top dead center. This condition can damage or destroy pistons, rings, bearings, crankshafts, and head gaskets.
Neither detonation nor Pre-Ignition is good for an engine. Detonation is likely to damage it, while Pre-Ignition can destroy it.
This ideal combustion process takes place without detonation or Pre-Ignition. Cylinder pressure rises smoothly as the piston rises in the cylinder. When the spark plug fires, cylinder pressure rises more rapidly because of the air / fuel mixture being burned with maximum pressure occuring at 12 to 15 degrees after TDC for maximum power.