As a weapon, the hammer is described as a perforating instrument on one side and blunting one on the other, possibly used since the Stone Age but was perfected for war during the Middle Age. It has a similar use when compared to the mace and other weapons wielded by knights. The handle could have several lengths. The long ones were used as infantry rod weapons against knights and the short ones were used in close combats or as part of the arsenal used on the horse. A third sharp point, coming out of the half of the head of the hammer, in the direction of the cable, made it even more versatile.
They were very useful against the better armors developed during the 14th and 15th centuries (when steel production was perfected). The warhammer could strike more powerful blows than swords - whose power was diminished with the use or armors. The great strengh of the blows could penetrate the adversary's defenses, especially when used by a mounted knight. Even when it didn't penetrate the armor, the impact caused serious damage. The blunt side of the head could be used to smash the target's armor, or even his shield. The other side could be used to perforate heavy armors. Against mounted adversaries, the blow could be directed to the horse's paws (poor things!), causing the enemy to be knocked to the ground, where it would be easier to fight.
Another weapons that are like warhammers include: the Bec of Corbin, Lucerne's Hammer and the cavalry pick. Since I'm not familiar with any of those, you'll probably see them mentioned here again.