Detonation: Detonation is the spontaneous combustion of the end-gas (remaining fuel/air mixture) in the chamber. It always occurs after normal combustion is initiated by the spark plug. The initial combustion at the spark plug is followed by a normal combustion burn. For some reason, likely heat and pressure, the end gas in the chamber spontaneously combusts. The key point here is that detonation occurs after you have initiated the normal combustion with the spark plug.
Pre-ignition: Pre-ignition is defined as the ignition of the mixture prior to the spark plug firing. Anytime something causes the mixture in the chamber to ignite prior to the spark plug event it is classified as pre-ignition. The two are completely different and abnormal phenomenon.