Knocking (also knock, detonation, spark knock, pinging or pinking) in spark ignition internal combustion engines occurs when combustion of some of the air/fuel mixture in the cylinder does not result from propagation of the flame front ignited 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 can be followed by knocking.
The phenomenon of detonation was described in November 1914 in a letter from Lodge Brothers (spark plug manufacturers, and sons of Sir Oliver Lodge) settling a discussion regarding the cause of "knocking" or "pinging" in motorcycles. In the letter they stated that an early ignition can give rise to the gas detonating instead of the usual expansion, and the sound that is produced by the detonation is the same as if the metal parts had been tapped with a hammer. It was further investigated and described by Harry Ricardo during experiments carried out between 1916 and 1919 to discover the reason for failures in aircraft engines.