Knocking (also knock, detonation, spark knock, pinging or pinking) in spark-ignition internal combustion engines occurs when combustion of the air/fuel mixture in the cylinder does not start off correctly in response to ignition by the spark plug, but one or more pockets of air/fuel mixture explode outside the envelope of the normal combustion front.
The fuel-air charge is meant to be ignited by the spark plug only, and at a precise point in the piston's stroke. Knock occurs when the peak of the combustion process no longer occurs at the optimum moment for the four-stroke cycle. The shock wave creates the characteristic metallic "pinging" sound, and cylinder pressure increases dramatically. Effects of engine knocking range from inconsequential to completely destructive.
Knocking should not be confused with pre-ignition – they are two separate events. However, pre-ignition is usually followed by knocking.
The phenomenon of detonation was first observed and described by Harry Ricardo during experiments carried out between 1916 and 1919 to discover the reason for failures in aircraft engines.