Since the very early days of humankind, we have always had a subtle (and sometimes not so subtle) urge to bludgeon our fellow humans into mushy pulp using hard objects. The cavemen knew this. The Byzantines acknowledged this. The Celts and Gauls were aware of it. Medieval knights relished it. Heck, even the sophisticates of the Rennaisance had the itch.
We don't really like to talk about this, of course, but when the artificial social restraints are stripped away, there really is no more manly way to defeat an opponent than by mashing him into fertilizer on the battlefield. That's why the mace and warhammer were considered weapons for the strongest and most capable of warriors
Maces and warhammers evolved and gained popularity over time, particularly when chainmail, ringmail and scale armor were invented. These types of armor made it difficult to kill an opponent with slashing weapons. The mace, however, could pulverize body parts without having to penetrate the armor. And pulverize they did. Maces and warhammers became extremely popular weapons and were responsible for uncountable deaths, injuries and accidental self-bonkings on the head (the last which really didn't do too much damage, but were likely a source of humiliation and jokes at the campfire after the battle).
Maces started life as clubs made from particularly big, heavy sticks. The big-stick arms race eventually led to big sticks with heavy balls of wood or rock affixed to the end. The next evolution was "heavy wood balls with knobby protrusions" (which, ironically was my nickname in high school). The knobby protrusions hurt a lot more than smooth wood, and caused more damage.
Eventually, with the advent of bronze and iron, metal maces came into fashion. These of course were much more lethal, although not as popular as swords and spears. It wasn't until the aforementioned popularity of metallic armor that the maces and warhammers truly enjoyed a robust popularity. Maces and hammers were also quite a bit cheaper to make, on average, than swords, so lower class warriors and some po' folk in general could afford them.
Flanged maces (maces with angular metal edges and points protruding from the head)were popularized circa 1200, when thick, nearly impenetrable plate armor was rendering both swords and maces less effective. The flanges were capable of focusing an enormous amount of power into a very small point. This allowed the mace to penetrate the armor a' la old fashioned can-openers.
An alternate version of a flanged mace was the spiked mace, which was basically a standard ball-headed mace with iron spikes lodged into it. The spikes were less effective against heavy armor, but really, really hurt if they hit lightly armored or, heaven forbid, unarmored opponents (or gerbils).