It really depends on your engine's electronic control unit (ECU) programming. If your ECU sets timing advance actively through a closed loop with the knock sensor, you can gain BHP/torque and improve fuel economy with higher octane fuel. This is because the ECU will continuously advance timing until knock is detected, back off a couple of degrees and repeat the process. In other words, it takes advantage of all the octane (anti-knock) characteristics of the fuel being used.
If, on the other hand, your ECU uses a map to set ignition timing as a function of RPM, throttle position, etc., then the benefit offered by the additional octane of a higher grade gasoline is wasted.