ECU should retard spark with lower octane fuel if knock is present, however reaction time is another thing altogether. Usually knock retard is also more than is needed, because once it starts, it can get bad fast, so any knock is not good for power or the engine.
Detonation is not really extra heat, heat = power in the internal combustion engine, detonation is firing at the wrong time, due to a spark plug or sharp area or exaust valve holding too much heat and pre-igniting/deiseling the mixture. If you fire prematurely, the piston could have enough upwards travel left in the compression stroke that you end up fighting the piston face/ringlands, and can blow something up. This can force extra compression to a point, but again if its happening before you want it too you are basically sending two fast moving objects on a collision course and something is going to break.