Not a hammer, it's a swage. The bottom swage fits in the hardie hole in the anvil, and the handle of the top swage is held by an assistant opposite of the bottom swage, and the red hot iron is between the two. The smith hits the top swage with his hammer, making a square bar. There were also flatters and fullers that were used the same way, as well as hot chisels with handles that kind of look like hammers, but are held by an assistant and the smith cut the hot metal off by hitting the chisel. Here are a couple of pictures of tools that look like hammers but aren't.
This is a hot punch This is a flatter. This is the base and the top round swage, and a finished hand forged handle showing what the smith did with the swage. And this is a top and bottom fuller.