In order for a firearm to fire a projectile, it’s necessary to for something to set it off.
Initially, whether it was a pistol or a long gun, it was loaded by pouring gun powder down the barrel, from the muzzle (muzzle-loading), and then seating the projectile on top of it, before firing.
The matchlock was the earliest method of achieving this, and that was done by applying a glowing cord to a touch-hole at the back of the barrel (the breech).
Soon, a considerable number of people performed a vast amount of work, and a series of furutre developments took place.
The first was the wheel-lock. This was a spring on the side of the firearm, which was then wound up like a clock spring. When it was released it struck a flint which sent a shower of sparks into the breech and set the charge (previously loaded from the muzzle as before) off.
Next, the flint-lock. This was a piece of shaped flint held in the jaws of a hanmer (or cock) which, when the trigger of the piece was released (far less complicated than the wheel-lock) and this also sent a shower of sparks into the breech, having struck a piece of steel (called the frizzen), thus, again, igniting the previously loaded charge.
The next major development was the percussion cap. This replaced the hammer retained flint with a similar hammer, but which then struck a brass cap containing the propellant, rather like a toy pistol cap, the cap having been placed over a hollow tube above the breech, called the nipple.
Then, with the invention of the self-contained cartridge, it was possible to load from the breech. The first system was the pinfire. This was a brass cartridge, containing the powder and the bullet,, with a short pin, sticking up at right-angles from the rim at the back of the cartridge containing the small charge, to set it off when struck.
It was only a short time, however, before this somewhat sensitive system was superseded by the rim-fire cartridge, where the ignition system was in the rim of the cartridge itself, and when that was struck, it set off the charge.
Finally, we have the centre-fire cartridge. Now the ignition system is a cap (or primer) set in the centre of the base of the cartridge, and when that is struck it sets off the projectile, and that is still the system we have today.