A hammer block and transfer bar use different method to accomplish the same basic thing: preventing the hammer from traveling far enough forward to ignite a primer unless the trigger is pulled.
All S&W revolvers made since WWII, with the exception of DAO "Centennial" models like the M40 and 42, have a sliding-type hammer block regardless of whether they have a hammer or frame mounted firing pin. The sliding-type hammer block is considered very safe and positive and a so-equipped revolver is just as safe to carry fully loaded as one with a transfer bar.
The hammer block itself is a small piece of metal that, when the action is at rest (hammer down, trigger fully forward) sits between the hammer and frame thus restricting the hammer's forward movement. When the trigger is pulled or hammer cocked, the trigger pushes the rebound slide backward. The bottom of the hammer block has a diagonal groove in it which sits over a stud on the side of the rebound slide so that as the rebound slide moves backward, the hammer block is pulled down and out of the path of the hammer. When the trigger moves forward (either by being released after firing the gun or from manually decocking), it allows the rebound slide spring to push the rebound slide forward. As the rebound slide moves forward, it both cams the hammer back a slight amount and pushes the hammer block up into position between the hammer and frame.
As has been mentioned, the only S&W revolvers made since WWII without hammer blocks are the DAO "Centennial" models. These models do not need hammer blocks because their hammers are completely enclosed within the frame thus making a blow to the hammer pretty much impossible.
A transfer bar, on the other hand works in what could be described as the opposite manner of a hammer block. In a transfer bar gun, the hammer has a small shelf on top of it which rests against the frame and thus prevents the hammer from directly contacting the firing pin (this is why all transfer bar revolvers have frame mounted firing pins). The transfer bar itself is a flat piece of metal that is hinged at the bottom to the back of the trigger. When the trigger moves backward by either being pulled or the hammer cocked, the transfer bar slides up into position between the hammer and firing pin. This, in essence, "fills the gap" between the face of the hammer and the firing pin so that when the hammer falls, its energy is transferred through the transfer bar to the firing pin (hence the name). As the trigger moves forward (either by being released after firing or by manually decocking) the transfer bar is pulled back downward and out of the path of the hammer.
As I explained before, both systems are equally positive and safe. The hammer block is, theoretically, slightly less prone to light strikes because none of the hammer's energy is lost through a transfer bar. That being said, I've shot many guns with both types and the only time that light strikes was ever a problem in a transfer bar gun was one which had lighter-than-factory springs installed. On the other hand, the transfer bar system uses fewer parts and looks to me like it would require less machining and thus be less expensive to produce.