You can flash, or go piggy back. Flashing allows modification of the stock fueling tables in addition to modifications such as RPM limit changes, kick stand switches, lights, PAIR valves, etc, but typically is tuned for a specific setup, i.e. pipe, filter, etc. Most available are probably pretty close and its the cheapest option usually. The pigggy-back controller + autotuner, allows you to tune for your specific conditions + setup, typically for a fixed point in time.
I ran the Bazzaz auto tuner a couple times over a 10 year period on the CBR, but things never changed much. I largely left it alone and it worked fine. The RapidBike controller in the R1 is an active piggy-back controller that utilizes an O2 sensor while it operates to make further adjustments on the fly. It's really just a feedback loop. It seems to work... but I can't say for sure what decisions the controller is making to the fuel real-time. It goes fast, so I assume its working.
The 08+ CBR1000RR was a closed ECU and was not usually flashed by owners. I'm sure some ECUs were killed by those that tried. The Traction Control feature in the fuel controller detects RPM spikes and interprets them as wheelspin. Modifying the injection in the same manner, it backs off the power. It's primitive but actually works reasonably well for what it is.
At a high level, adding a piggyback controller (which ties into the injector and a few other places) takes an injector signal, routes it into the aftermarket controler and uses this + RPM + gear position (sometimes) + other sensor tye-ins to say "oh you asked for this much fuel, I'm going to change it a little bit based on my table/calculations".
Hopefully that helps.