As mentioned, there's no sensor or switch in the car that says "ooh, he just gave it the good stuff, we got 250HP now"
The power adjustment is mainly a result of timing adjustments. With higher octane fuel, the engine can run more aggressive timing without knocking. Knocking is very bad so this...