The compression ratio is the difference between the space the air takes up when the piston is decompressed as much as possible and when it is compressed as much as possible. A higher octane rating is required in engines with a higher compression ratio to prevent detonation and pinging, which occurs when lower octane fuel combusts too soon.
The ratio is comparing how much space is in the combustion chamber when the piston is as far down as it will go, compared to when it reaches the peak, where everything is compressed as much as it will be, so the result is a description of how much the air/fuel mixture is compressed by each of the engine's cylinders.