In a hammer fired mechanism, the hammer is a heavy piece that is allowed to rotate about a pivot point. When the hammer is cocked, it compresses a spring. When the trigger is released, the spring pushes the hammer and forces it to rotate forward. The end of the hammer strikes the back end of a firing pin, which is a thin steel pin with a hardened tip. The front end of the firing pin strikes the primer of the cartridge, thereby detonating it. The image below shows how this works.
In some revolvers, the firing pin is attached to the hammer directly.
Firing pin attached to the hammer of a Smith & Wesson Model 13 revolver.
Image licensed under Creative Commons Attribution-Share Alike 3.0 Unported license.
In either case, the key part of the mechanism is a rotating hammer mechanism. Here's another animation showing the same concept.
In contrast to this, striker fired systems operate in linear fashion. The striker is a part that is a bit heavier than a firing pin and it is directly connected to a spring. When the firearm is cocked, the striker is moved against a linear spring and held in position. When the trigger is released, the spring forces the striker forward with enough energy to detonate the primer upon impact. The animated image below shows how this works.
The striker is the long part in the back of the gun that looks like this:
It should be noted that the animation example for a striker fired weapon shows the firing mechanism of a Glock pistol. When a Glock is cocked, the striker is moved back and held under partial spring compression by the trigger mechanism and safety devices. As the trigger is pulled, the striker is initially pulled back till the spring reaches full compression and then the striker is released. In other pistol models, such as Springfield XD or Smith & Wesson M&P models, the striker is already held at full spring pressure when it is cocked. Pulling the trigger in such firearms merely releases the striker and allows it to fly forward
From the above images, we see that hammer fired mechanisms use a rotational force to detonate the primer, whereas striker fired mechanisms use a linear force to do it.
Striker fired mechanisms tend to have fewer parts than hammer fired mechanisms and are therefore simpler. However, they take up a bit more room. This is why firearms that don't have bolts, such as revolvers, use a hammer-fired action. Revolver and many types of single-shot action firearms generally don't have the room to accommodate a striker mechanism.
Strikers are commonly found in many modern semi-automatic pistols, bolt action weapons and shotguns. In fact, the first striker fired weapon invented was a shotgun invented by Daniel LeFever in 1878. Another example of a striker fired weapon is the Czech vz.58, which we studied earlier (contrast this with the similar looking AKM rifle, which uses a hammer fired mechanism). Striker fired pistols started becoming popular in the 1980s, when Glock started using them on their pistols. However, it must be noted that Glock weren't the first to use it on pistols either: John Browing used it in the .25 caliber Model N pistol and the H&K P7 is striker fired as well. Nevertheless, once Glock started becoming popular, other manufacturers also started using the same idea on a larger scale and now you have several pistol models, such as Smith & Wesson M&P, Springfield XD, Ruger SR9 etc. However, there are some famous pistol models that use a hammer fired mechanism instead. Examples include the Colt M1911, Browning Hi-Power, Beretta M9 etc.
A striker fired mechanism doesn't have an exposed hammer, so it cannot get caught in clothing, shrubs etc. The fact that it has fewer parts means easier maintenance as well. Another positive is that it has a consistent trigger pull for every shot (in contrast to double action/single action hammer fired mechanisms, where the trigger pull force is different depending on whether the firearm is working in single action mode or double action mode). Striker fired mechanisms generally have a consistent trigger reset as well.
On the other hand, if there is a malfunction on a striker fired weapon because the primer didn't detonate, the only option is to eject the cartridge and try the next one. With a hammer fired firearm, it may be possible to try again on the same cartridge (on models that provide this second-strike capability). Hammer fired guns also generally impact primers harder than strikers do, thereby giving a better chance to detonate them. It is for these reasons that many military forces prefer hammer fired weapons. For example, the US military's choices of weapons: Colt M1911 pistol, Beretta M9 pistol, M1 Garand, M14 rifle, M16 rifle, M4 carbine etc. are all hammer-fired.
The video below shows some of the advantages and disadvantages of each system:
As you can see, each mechanism has its own group of fans that argue about which is better. Happy viewing.