A hammer is composed of a shaft and a head, assembled in a 'T' formation.
The shaft (generally of wood) fits between the user's hand and the hammer's head. It is what you grab to use the hammer. The longer the shaft, the more force can be exterted by the head, but at the same time, the slower the hammer becomes to use.
The head (generally made of metal or (in primitive societies) of stone) is what does the striking -- the striking surface with generally be flat or slightly convex. There may be a second striking surface on the other side of the 'T', either of the same size and shape, or designed differently, for a different striking effect.
The hammer was eventually modified for use in combat. This is a war-hammer or a maul. Like the tool, a war-hammer could be used for gripping and striking (being as how most plate armour was hammered metal, a hammer could do a good deal to deform a plate), even against mail, which the hammer deformed inward, causing it to transmit the blow to the armour and flesh underneath. Or they could be thrown, as a high-mass blunt-impact missile, over short distances. They could be mounted on longer shafts, in the manner of a two-handed weapon, when although they were slower, they packed a substantially heavier impact. As such they were also useful for work against structures -- doors, stone walls, etc.