The octane number you see at the
gas pump is an indicator of the gasoline's ability to resist "
knock", which is the engine
pinging caused by
premature ignition.
To determine the octane of a gasoline, two test fuels (heptane and isooctane) are mixed and compared against it. Heptane has an octane number of zero, while isooctane has a value of 100. The subject gasoline is compared against various mixes of heptane and isooctane until an equivalent knock is found. The percentage of isooctane in the mixture used for that test is determined to be the octane rating of the tested gasoline.
For example, if a gasoline is found to have a knock similiar a mixture of 90% isooctane and 10% heptane, that gasoline is marked as having an octane rating of 90.