Gas is made up of hydrocarbons. These hydrocarbons are named based on how many carbon atoms they have:
Propane has three carbons, butane has four, heptane has seven and octane has eight.
The octane rating of a gasoline tells you how musch the fuel can be compressed before it ignites on its own. Igniting spontaneously is bad for your engine, unless you drive a diesel.
Heptane ignites under relatively little compression, while octane handles compression better.
The octane rating is the ratio of octane to heptane in gas. 85 octane is 85% octane and 15% heptane, or the equivalent of such a mixture in other hydrocarbons. The fewer carbons a hydrocarbon has, the easier it ignites etc.