In simplistic terms.... in a given engine design with unaltered intake/exhaust, you can increase HP in two ways:
1) increase compression ratio, and 2) increase timing (up to a point). Both of those protocols will likely require increased octane.
In the old days, it was easy to adjust the timing on your engine, and also to alter your compression ratio (though not quite as easy as adjusting timing!). If your engine knocked, you could retard the timing until it ran fine on whatever gasoline you fed it. OTOH, if you had access to cheap high-octane gasoline, you could advance the timing and get a cheap performance boost (increased HP and MPG).
Manufacturers have locked down the tinkering with timing by controlling it with a computer. Many aftermarket "performance tuners" utilize that computer control to adjust timing for you. However, messing with the tuning can and will alter emissions, and the engine may not be within the mfrs emissions specs (thus why mfrs like to keep it locked down, especially so in Honda's case).
Nearly every modern automobile engine has the ability to adjust timing on the fly, depending on conditions. If engine knock, or ping, is detected, the ECU will retard the timing until the engine runs smoothly. This is a good thing since it protects the engine! The ECU will also advance the timing if fuel quality allows, but how far that advance will go depends on the engine amd application. Again, it will affect emissions, so mfrs have a small window to play with. If your engine runs at max timing on 87-octane as designed by the mfr, then running 89-octane or higher will do nothing for you. If the ECU can advance the timing further, however, then higher octane may provide benefits. This has been shown in the G1 Ridgeline, but has not been proven for the G2 Ridgeline.
As an aside, some automakers would like higher-octane fuels (e.g. - 91) to become standard. This would allow them to increase engine compression ratios and/or advance timing to give engines more HP and, more importantly, more MPG. The mfr gets to sell vehicles with higher specs, and the buyer pays extra at the pump. Many performance/luxury brands do this already.
Also, you may hear about race cars running ethanol (ethanol lobbyists LOVE to promote this!). The fact is ethanol has a higher octane than gasoline. If you build an engine to run specifically on ethanol and not gasoline, you will get greater performance out of it. However, high ethanol content fuel is not ready for prime time. Alcohol still has very bad drying effects on some engine components, as well as problematic water-absorption properties. The corn ethanol we are using is bad for the environment, and people don't want to switch to switchgrass ethanol which is much better for the environment than petrol or corn ethanol.
There you have it in simplistic terms.