Knocking in spark-ignition engines occurs when the fuel-air mixture spontaneously and violently ignites ahead of the normal flame front.