The lower the timing, the later the cylinder fires, less compression, less power.
Knock is detected by knock sensors, pcm has tables that tell it what to do for each degree of knock and when to react. It will lower your timing (retard) but if you are getting too much knock, it may be too little too late considering how fast the motor is spinning and how fast the pcm is processing all of this.