Following are some of the main reasons for detonation, (may not cover all aspects) –
(a) improper ignition timing, i.e spark doesn’t generate at precise timing
(b) rich air – fuel mixture
(c) improper spark plug setting (distance between two electrodes should be precise as per original setting)
(d) overheating of the spark plug
(e) accumulation of carbon deposits over a period of time
(f) bad quality of gasoline