An engine's compression ratio is the ratio of the volume of gas in the cylinder when the piston is at the top of its stroke (top dead centre, or TDC) to the volume of gas when the piston's at the bottom of its stroke (bottom dead centre or BDC). In other words, it's the ratio of compressed to uncompressed gas, or how tightly the incoming fuel/air mix is squeezed into the combustion chamber before it's ignited. The more it's squeezed, the more efficiently it burns and the more power is made.
Apparently small changes to an engine will make a significant difference. 'Skimming' the cylinder head by machining away its bottom face where it mounts flat against the cylinder barrel (which effectively reduces the combustion chamber's volume) or fitting a thinner head gasket will increase the compression ratio, as will fitting 'high compression' pistons with a raised crown. Any modification that reduces the volume of the combustion chamber will raise compression, but it is also affected in other ways too.
Boring out a motor or increasing its stroke gives more power not only by increasing capacity, but also by boosting compression. Say we have a 500cc single-cylinder engine with a bore of 100mm and a stroke of 63.66mm. Let's also say its cylinder has a combustion chamber volume of, for the sake of easy calculation, 50cc. With the piston at BDC, the total volume of the cylinder is 550cc. With the piston at TDC, the volume is reduced to 50cc. Its compression ratio, therefore, is 550 divided by 50, or 11:1. But if we give the engine a 2mm overbore and make no other modifications, its displacement is now 520cc. Total cylinder volume is up to 570cc, reduced once again to 50cc at TDC. Dividing 570 by 50 gives 11.4:1. By increasing the engine's displacement we've changed the ratio of compressed to uncompressed gas volumes, and increased the compression ratio.
Whichever way we go about it boosting the compression ratio is an easy route to more power. High compression pistons are, according to FW Development's Ian Park, "bolt-on horsepower". Modern bike engines tend to run compression ratios in the 10:1 to 12:1 region. By way of an example, a standard CBR600RR has a 12:1 compression ratio, while an FW Developments supersport-tuned RR will run at around 15:1.
But there are limits to how high the compression ratio can go. The trouble with petrol is that if it is compressed too much it starts igniting of its own accord, rather than when you want it to. This is known as detonation or 'knocking', and it's this that prevents engines running very high compression ratios.
Compressing a gas raises its temperature, so as the piston rises and the fuel/air mix is compressed, it heats up. In an ideal world the compressed fuel/air mix ignites from a central point in the combustion chamber (where the spark plug is), expanding out evenly in all directions and pushing the piston down (because that's the only bit that can move at this point). Raise the compression ratio too far and a spontaneous auto-ignition occurs towards the outer edges of the combustion chamber, instigated by the sudden rise in cylinder pressure when the spark plug ignites, instead of burning outwards from a central point.
This uneven, spontaneous burn produces amplified pressure waves in the combustion chamber. A metallic knocking sound can even be heard from the engine as these high pressure waves hit the piston crown and the sides of the combustion chamber, hence the term 'knocking'. While these pressure waves are very short-lived, they are higher than normal combustion pressure - and temperature - and can cause all sorts of problems, from blown head gaskets to damaged pistons and overstressed rods and bearings. Overheating can also be a problem.
A fuel's octane rating is a measure of its resistance to detonation - the higher the rating the more it can be compressed without detonation occurring. Normal unleaded pump fuel with a 95-Ron octane rating is fine for most standard engines' compression ratios, but even mildly-tuned engines might need 97/98-Ron super unleaded fuel to run safely.