How a cartridge works

A cartridge is made up of 4 basic parts. The bullet, the case, the propellant powder and the primer that ignites the powder.
The primer:
The first illustration shows how the primer works. The primer is basically a more powerful version of the cap we all used in our capguns as kids. It is seated in the centre of the end of the cartridge case (hence the term 'centrefire') and it's job is to ignite the powder. The firing pin hitting the primer traps the lead styphnate and powdered glass mixture against the anvil causing it to explode violently. The resulting flame from the primer passes through the three holes in the anvil, and the flash hole in the case, into the powder charge.
Unfired cartridge:
This illustration shows the freshly loaded cartridge. The end of the bolt (the 'boltface') can be seen on the left. The bolt holds the cartridge in the chamber. At this moment, the firing pin is retracted inside the centre of the bolt face under spring tension. The propellant charge can be seen in the picture, it is connected to the primer though the flash hole in the case.

Modern smokeless powders are all based on nitrocellulose, with some also containing nitroglycerine, and are available in many different brands and types, the main difference between them being the speed at which the powder burns. In general, smaller calibres and shorter, fatter cases use faster powders while bigger calibres and longer, narrower cases use slower powders.
Pulling the trigger:
Pulling the trigger releases the firing pin from the bolt and it flies forwards and strikes the primer. This ignites the compound in the primer which explodes violently and projects a very hot flame through the flash hole into the case igniting the propellant.

(Primers, which cost about £2.50 a hundred, are available from any gun shop that sells reloading equipment. A recent change in legislation means that you must now show your FAC when purchasing primers although they are not actually written onto the ticket as ammunition is).
Powder ignition:
The ignition of the powder generates a pressure of upto 55,000 PSI which propels the bullet along and out of the barrel.

Interestingly, it is this extremely high pressure gas leaving the barrel (~10,000 PSI) behind the bullet that generates a great deal of the felt recoil of a rifle. A muzzle break, a device attached to the end of the barrel that diverts alot of this gas sideways instead of forwards, can really help reduce the recoil of heavier calibres and make them alot more pleasant to shoot. Moderators have a similar recoil reducing effect by trapping and cooling alot of this hot gas.