Pinging or spark knock is not the same as detonation.
Pinging is preignition of the fuel air charge by some source of ignition other than the spark plug. The source of the ignition can be a hot spot in the combustion chamber such as carbon, a spark plug insulator, side electrode, or a sharp edge on a valve. It occurs before the spark plug can fire and while the piston is still on its upward movement towards TDC. That is the cause of the characteristic ping or ringing sound, much like shaking a coffee can full of BB’s.
Detonation is the uncontrolled explosion of the fuel air charge after the spark plug fires and starts to burn. In a properly running engine, the spark plug ignites the fuel air charge and it burns slowly and evenly across the combustion chamber, much like a fire as it burns its way across a grassy field. When detonation occurs, the ignited fuel air charge causes an increase in the combustion chamber pressure and temperature. The remaining fuel air charge that has not been burned self–ignites explosively causing tremendous heat and pressure. The source of secondary ignition can be the same as preignition, or can be simply due to the heat and pressure. Detonation is what damages engine parts because of the excessive heat and pressure.
Pinging can lead to detonation, and the results are the same: engine damage because of the excessive heat and pressure