When spark ignited combustion is not complete for the fuel/air mixture in a cylinder, unburnt mixture "explodes" due to compression creating a knokinging of pinging noise.