The reason for increased fuel efficiency in the engines using higher octane is that engines requiring higher octane have higher static compression ratios and/or higher boost supercharging systems.
The higher cylinder pressure in engines with higher static compression ratios and/or higher boost makes more efficient use of fuel. It also makes more horsepower and torque (actually horsepower is just the rate at which an engine makes torque, which is the rotational force that actually does the work). This of course assumes all else being equal.
Good examples can be found in the history of the V1710 Allison engines. Later engines had more static compression (the early models were all under 6.5:1, as low as just under 6:1, while later engines were over 6.5:1, some near 7:1) and were run at higher boost levels. The later engines had more horsepower and better fuel efficiency.
In many cases, you find that engines with low static compression ratios run at higher boost levels make more PEAK horsepower. However, they are very slow to accelerate when they are not running at high boost, and they are much less efficient. Engines with lower compression are also more prone to foul spark plugs. Higher boost levels are more prone to cause headgasket and cylinder head failures.
Other things to notice are that turbocharged engines tend to be more efficient than engines with crank driven superchargers. The reason being that the faster you spin a crankdriven supercharger the more boost increases, but also more power is absorbed. At a certain point, the amount of power absorbed will begin to increase much faster than the amount of power gained by the increase in boost.
The turbocharger is more efficient because it uses the heat and expansion of exhaust gases to compress air in the intake tract. Using these gasses does not absorb power from the crankshaft. However, at some point, depending on the size of the turbocharger in relation to the size of the engine, the backpressure in the exhaust will increase to the point where no more power is gained by the increased boost level.
One reason for the increased power per cubic inch of displacement of the German engines was the fact that German engine manufacturers were the world leaders in FUEL INJECTION. True fuel injection eliminates problems like flooding, starvation, and poor mixture distribution.