How does detonation occur? In a simple sense the fuel simply explodes instead of burning in a controlled manner. How does it happen? If compression is excessively high, the fuel/air mixture will be compressed to the point it explodes (diesels). Since the piston might not be where its supposed to be (early in the cycle), the explosion provides a back force on the piston, attempting to run the engine backwards. This doesn't happen hormally (except a start backfire situation) because the flywheels momentum overcomes the detonation. What you hear (most often) is a "pinging" sound. What you feel is a hesitation in engine performance. If this process repeats it destroys the piston tops, eventually cutting through them and subsequently destroying the engine.
If you get pinging on acceleration but it goes away in cruise, up the octane gasoline you use. If this doesn't cure the problem, then see your tune up expert and explain the problem.
Normally speaking the engines computer adjusts the fuel/air mixture to accommodate engine performance that's satisfactory. This is why a computer controlled engine is superior to a carbureted engine (no computer). Whereas the carbonated engine may require 91 octane (or higher) to avoid pinging, the computer controlled engine can use 87 octane with equal or better performance.
Hope this helps.
Jeff