Ignition timing is the measurement, in degrees of crankshaft rotation, of the point at which the spark plugs fire in each of the cylinders. It is measured in degrees before or after Top Dead Center (TDC) of the compression stroke.
Ideally, the air/fuel mixture in the cylinder will be ignited by the spark plug just as the piston passes TDC of the compression stroke. If this happens, the piston will be beginning the power stroke just as the compressed and ignited air/fuel mixture starts to expand. The expansion of the air/fuel mixture then forces the piston down on the power stroke and turns the crankshaft.
Because it takes a fraction of a second for the spark plug to ignite the mixture in the cylinder, the spark plug must fire a little before the piston reaches TDC. Otherwise, the mixture will not be completely ignited as the piston passes TDC, and the engine will not use the full power of the explosion.
As the engine speed increases, the pistons go faster. The spark plugs therefore have to ignite the fuel even sooner if it is to be completely ignited when the piston reaches TDC.
The Powertrain Control Module (PCM) receives inputs from Crankshaft Position (CKP) sensors and Camshaft Position (CMP) sensors along with various other sensors to control spark timing. Refer "Engine Electrical" for more information.