Causes of detonation?

That ones a rather shallow definition. But they are seperate issues. Pinging you wil always hear. Detonation is sometimes silent. Pinging is caused primarilly by hot spots lighting the air/fuel mix rather than the spark. This could be carbon, points, edges, or the casting. It's a domino effect too. Once it starts, until the heat is removed it will continue. Ping makes heat-heat makes hot spots hotter-more ping. Octane helps control the tendency for fuel to ignite.. And any oil will drop the octane instantly and drastically.