Simply put, the octane rating of a gasoline is its ability to resist knock, a sharp metallic noise resulting from detonation or uncontrolled combustion in the cylinder. Knock can occur for a variety of reasons, one of which is the incorrect octane rating for the engine in your vehicle. To understand why knock occurs, you must understand why knock doesn't occur. So let's look at the normal combustion process.
Under normal operating conditions, the firing of the spark plug initiates the burning of the fuel air mixture in the combustion chamber. Once the plug fires, a wall of flame starts outward from the plug in all directions at once. This flame front moves evenly and rapidly throughout the entire combustion chamber until the entire fuel/air mixture is burned. This even, rapid progress of the burning fuel/air mixture is highly dependent on the octane rating of the gasoline.
If the octane rating is too low, the last part of the compressed fuel/air mixture may ignite before the flame front reaches it, in effect creating two areas of combustion within the cylinder. However, while the original combustion is proceeding at a carefully controlled rate, this new combustion is simply a sudden sharp explosion. This abrupt increase in pressure is what creates the knocking sound in the combustion chamber.
As far as the piston is concerned, the damage inflicted by the increase in pressure (caused by the sudden explosion) is exactly like striking the piston top with a heavy hammer. Knock is very damaging to the engine, since it causes extraordinary wear to bearings, piston crowns, and other vital engine parts. Engines can actually be destroyed through excessive engine knock.
Engine knock can be controlled by using a gas with the proper octane rating. Octane measurements made under laboratory conditions have led to "Research" and "Motor" octane ratings. In general, the research octane number tends to be about 6–10 points higher than the motor octane rating (for what is essentially the same gasoline). Since the early seventies, most octane ratings on gas pumps have been the average of the research and motor octane numbers. For instance, if the gasoline formerly had a research octane rating of 100, and a motor octane rating of 90, the octane rating found on the pump now would be 95.
Your owner's manual will probably indicate the type of gasoline and octane recommended for use in your vehicle. However, octane requirements can vary according to the vehicle and the conditions under which it is operating. If you encounter sustained engine knock, wait until your tank is nearly empty, and then try a gasoline with a higher octane rating. Don't needlessly overbuy — it's a waste of money to buy gasoline of a higher octane than your engine requires in order to satisfy its anti-knock need.
As a new vehicle is driven, combustion deposits build up and the octane requirement increases until an equilibrium level, normally between four and six octane numbers higher than the new-vehicle requirement, is reached. Other factors which can increase the octane an engine requires are higher air or engine temperatures, lower altitudes, lower humidity, a more advanced ignition spark timing, a leaner fuel/air mixture, sudden acceleration, and frequent stop-and-go driving which increases the build-up of combustion chamber deposits.