Your "three fuel grades" question is not so simple: all gasoline has about the same chemical/potential energy. Diesel, of course, is a whole different critter.
The Octane Rating refers to the anti-knock properties of the fuel in question, not its available heat. Smaller engines (generally) have higher compression than larger engines: the 7.6 liter V-8 in my Chevy pickup has an 8.6-1 compression ratio, and the 4.7 iter engine in my wife's Kia has 9.5-1. That means, I get better energy transfer (not higher energy) from the faster-burning, low-octane rated fuel in the Chevy, while the Kia gets better energy transfer from the slower-burning high-octane fuel.
Not all fuels are created equal. My Beechcraft has a Continental 775 hp engine, with 12.9-1 compression. It requires 108 performance-number fuel. Most aircraft fuel will not burn properly in an auto. Few auto fuels will burn at all in an aircraft.
Note that motor fuels are designated differently. 86 octane burns faster than 95 octane. Faster turning engines require faster burning fuel to be efficient. Slower engines use slower fuel. However, when you use your small truck to haul unduly heavy loads, use the cooler-running premium fuel, unless you like to rebuild engines.
Now, as to diesel. My International 1600 requires no. 2, low-sulfur diesel. It has a mild 34-1 compression ratio. That is mild for a diesel. The new Kenworth (w/ Cummins) runs at 36-1 compression and requires no. 1 diesel -- basically pure kerosene.
Jets use triple-distilled kerosene (JP-8) because that is the way to stuff the most power into a fuel tank.
If you feel like sheer madness, take a whiff of the fuel at a dragstrip: it smells funny, because most fuel-funny cars and dragsters use nitromethane fuel -- a Class-B explosive. They blend it with a well-considered "vehicle" which can be kerosene, lacquer thinner, gasoline, or other carefully-guarded racing secrets. In some racecars, they want the power of nitromethane but not true flame-deflagration, so they might add a small percentage of graphite to assure slower detonation and ample cylinder lube. Fifteen years ago, NHRA outlawed the use of lithium-based lubricants in explosive fuels: LiCO/3 is extremely toxic, where graphite (pure carbon) results in CO+ CO/2 + H/2\O + H/2\CO/3 ++ NO/x is a much less poisonous exuaust mess.