When the knock sensor detects detonation, it sends a signal to the engine control unit (ECU). The ECU then adjusts the ignition timing, retarding (delaying) it to reduce the likelihood of further knocking. This helps protect the engine from damage caused by detonation. In some cases, it might also adjust the fuel mixture slightly.