Why would you choose a mace or hammer over the sword?
Swords are often the most romanticized and sought after pieces for a collector and modern HEMA martial artist. The truth is, you would find many more of these simpler weapons on the medieval battlefield than the sword. A knight would train with the sword from a very young age and would normally be noble at birth. The time and expense to train a knight was very costly as was the price of a sword smith and quality armorer to outfit and protect your investment. Thousands of infantrymen would be trained strikes and strategies with clubs, maces and hammers until later periods when the warhammer became an effective and regular piece of equipment in the knight's arsenal as well.
How would you use war hammers and maces?
There are several key strategies but the main thing that is always true. You must find a way to break through your opponents defenses to be effective. In the early periods or dark ages most opponents would be protected in maille armor and possibly carry a shield. These types of weapons can be swung with quite the momentum and can knock a shield from someones hand if used well. With this defense removed your opponent would still be impervious to cuts in a suit of maille but was still susceptible to bludgeoning attacks. This could deliver many types of injury resulting in a victory.
Once armor evolved into full plate, strategy began to change as well. These new knights were like tanks but not without weakness, especially to the war hammer. Many hammers and pole arms would have a bludgeoning end but would also be equip with one or more spikes or spear points for digging in weak areas of the armor like the elbow joints and armpits. Some heavy spikes could also pierce straight through poorly constructed plate. The hammer if used correctly could also impair your opponents mobility by denting the armor so the articulated joints would bind up and fail. Your opponent would quickly be at your mercy if he could no longer lift his arms because of dented pauldrons.