Gasoline or petrol is a more volatile fuel than diesel or kerosene. The reason for this is not only the base constituents, but the additives that are put into it. Because the mixture has a tendency to explode or "knock", Lead additives were added in the 1960s and 1970s, but removed later as it was found that there were major environmental side effects (pollution). there are also additives to reduce internal engine carbon buildups, to increase oxidation, and others to allow easier starting in cold climates.
Octane is a measure of how resistant gasoline is to premature detonation (knocking). It is measured relative to a mixture of octane and heptane. So an 87 octane gas has the same knock resistant as a 87% octane/ 13% heptane mixture.? (These are specific isomers of octane and heptane. Someone who knows should tell us which ones.)