Higher octane fuel is richer in light alcohols (methanol, ethanol and such) which have less btu's/liter. By itself, this would hardly have a noticable effect. However, these substances have a higher enthalpy of vaporization, meaning it takes more energy for them to boil. They boil upon entering the cylinder, due to the vaccum created by the piston going down, however they take more energy in the process, cooling down the cylinder. This is especially pronounced on methanol power dragsters, where the engine temperature is actually cooler at the end of the run than it is in the beginning.
This has advantages or disadvantage. On one hand the cooling of the cylinder allows the engine to run harder, due to boost, ignition advance, or whatever. Thats where the resistance to detonation comes from. On the other hand, if the cylinder is colder, more of the energy of combustion goes to heat it up, leaving less to push the piston down, which robs power. This effect is considerably more apperrent than the btu's/liter difference