Yep, although not all knock sensors are created equal - the old 200SX one didnt work at all, the DE one is crap but the HR one seems to be decent. They work by retarding the ignition if it senses knock, if this doesnt happen then you run the risk of serious piston/valve/chamber/big end damage.
The guy I bought my 135 from (mapped for V Power) said he was forced to use 95 RON for a week or so, after the 3rd tank the car just refused to rev past 6K at all - thats a PROPER knock sensor.
So it's retarded meaning the spark happens later in the compression stroke meaning there's less time for hot gases to collect and the air/fuel is under less pressure for less time meaning less heat from both sources, therefore less chance of abnormally detonating?
For me to write nearly 4 paragraphs about det and for Doc to give the nod of approval this is a good day all round!