There are times the knock sensor will be used to protect against too much advance, all the time in fact, but the reason knock sensors became widely used across cars built in one factory and destined for use in other markets is because fuel quality is so variable. A lower octane fuel is more prone to knock, Brazillian cars (Brazil has some particularly poor fuel) with automatic knock detection, will keep the timing much less advanced than if the same car were picked up and put in the USA and fed premium 97 or 98 RON (equivalent) fuel.
Knock, pre-ignition, is one of the most destructive transient problems and engine can have and a high performance turbo'd engine can be destroyed in seconds by knock
Running maximum advance is not the absolute best way to get more power as I and most people have at once time thought. You only need maximum power when you put the engine under high loads,, so attempts to save fuel by leaning the mixture out and setting the timing later and earlier and other attempts to create a smoother light load cruise feeling and other characteristics, are implemented by playing with the timing away from what might have been thought to be the 'best power' timing.
The maximum pressure peak is timed to come at between 15-20 after TDC. Depending on the fuel quality, barometric pressure (if using carbs particularly), mixture ratio (tied to barometric pressure), calculated load demand (figured out by the ECU), the timing should be moved to put the maximum pressure peak at the correct time - and that is all you can say about where the timing should be - it should be where it needs to be in order to get best power from the current parameters and load conditions - in order to maximise efficiency. But it's noted by many tuners, and perhaps it is particularly obvious with turbo and supercharged cars, that maximum power isn't at maximum safe advance all of the time.
Turbo'd cars suffer knock readily, and the 'thing to do' is to turn the mixture ratio down low, sometimes to 10:1 , when the knocking stops and more power is felt. But what a lot of tuners have seen is that by retarding the timing they bring the peak pressure back to where it should be. Enrichening a knocking engine works because the mixture is being overloaded and combustion is being slowed, so knock is prevented and the slower burning mixture develops peak pressure later. The difference in the amount of power generated between retarding the timing of the knocking mixture, and adding more fuel to stop the knocking, is sometimes negligible.
It's probably impossible to talk about this sort of thing in a couple of messages and do it any real justice, because as far as I'm concerned, proper tuning, not just 'tuning to get a quick jump in power and make sure there's no knocking' , is a real artform.
Our bikes don't have knock sensors, and dealers in different world regions may even have to reflash software in some bikes to account for the fuel quality. (I know some car dealers have had to do this in the past)......or perhaps the mechanics just note that when they set bikes up as part of a service they always seem to have to retard the timing in poor fuel quality areas. Who knows ?....that information is 'out there', somewhere.
You asked about my background. It's probably the same as most bikers with a bit of mechanical aptitude, family members were in engineering so exposure to the topics at a young age was inevitable. Meccano was a key influence in teaching me the basics
. Parents thought I would get in trouble on street corners so my dad dragged me to nightschool to gain City and Guilds in amateur radio (ham radio) when I was 14. Bored to the back teeth with school and didn't want to go to university because 'it was just for posh kids' (possibly a mistake), I tried the Army (REME), passed a gruelling 3 month potential officer candidate selection course (1 of 3 finishers from a class of 35), and some basic training at Deepcut (one and only), it came to signing up for a minimum 9 years and I thought I would have more fun by going to civvy street (another mistake perhaps)....so then my interest in photography got me a job in a film processing lab in Leeds, where I ran the chemistry, processed the films and did all the machine maintenance in downtime....found I enjoyed maintenance work a lot and got a job starting in Edinburgh when I was 22 servicing medium volume photocopiers. I've been in the printing industry most of the time since then. Always loved cars, passed my test 3 weeks after 17th birthday and have always done my own MOT work. After being in Scotland for a few years I got into bikes (mum was a nurse so it wasn't allowed back home) and did my training in Cupar....had a bike most of the time since then. Took a couple of years from printing to do despatch riding , didn't get rich, but almost got lost having too much fun......then got married and steadied myself in printing again.....then did some chef training......then tried to get into teaching but needed that degree that only posh kids did, so at 36 I started at Edinburgh Napier on a Mechatronics degree to consolidate my experience and fill some gaps in my knowledge, finished when I was 40, then was told I needed to do higher English literature for a year in order to get to teacher training college, but I needed to get back into work to pay the mortgage and got a good job on the back of my degree, back in printing, in the banking sector on high volume inkjet systems. (I'm second on the right in the picture below) Mostly I work with continuous printing systems, large reels of paper weighing nearly a ton, running through machines at 150m/min , you haven't seen a real papercut until you see what the edge of that can do ! For the past 20 years I've been into programming microcontrollers (and PLC's for my work) hence my interest in ECU programming and all that jazz.
I still haven't done half the things I think I want to do, but when i get out on the bike none of that seems to matter really 
Chris
Edited by fixitsan, 11 February 2016 - 09:16 am.