Rimfire and centerfire primer ignition systems and how they work.
In a rimfire system, a bullet’s gunpowder is ignited by a primer when the rim of a cartridge is struck by a gun’s firing pin.
In a centerfire system, a bullet’s gunpowder is ignited by a primer when the center of a cartridge is struck by a gun’s firing pin.
Rimfire systems are used in smaller caliber cartridges like the .22LR because the cartridge wall needs to be thin enough to be crushed by the gun’s firing pin.
Larger caliber cartridges use the centerfire system, and today the vast majority of ammunition produced is centerfire.
The primer in centerfire system is a metal cup that holds a primary explosive. The firing pin of the gun impacts the primer and crushes the explosive between the cup and an anvil.
There are two kinds of primers for centerfire systems
The two types are called the Berdan and Boxer, with the main difference being the location of the anvil. The separate stirrup design of the boxer primer makes no difference in performance but allows for easier removal of spent primers, making them easier to reload. U.S. factory-made commercial centerfire cartridges are Boxer-primed.
There are four sizes of primers for common centerfire cartridges: small pistol, large pistol, small rifle, and large rifle.
More info on this topic can be found in this NRA video.