The hammer of a firearm was given its name for both resemblance and functional similarity to the common tool. The function of the hammer is to strike the firing pin in a firearm, which in turn detonates the impact-sensitive cartridge primer.
When the trigger of a firearm is depressed, it acts on the sear, which in turn releases the spring-tensioned hammer. Some firearms have a striker instead of a hammer and firing pin.
See also[]
The original article can be found at Hammer (firearm) and the edit history here.