How the Rifle and Handgun Fire

The bolt moves forward, compressing the firing pin spring and inserting a cartridge into the chamber.
The firing pin is held back under spring tension.
When the trigger is squeezed, the firing pin moves forward, crushing and igniting the primer in the cartridge base.
The primer ignites the gunpowder, generating gas pressure, which forces the bullet forward and out of the barrel.