Given how much time they spend pecking my metal chimney cap, they seem like they must be one of the dumber birds.
He's drumming on the metal chimney cap because it's the loudest thing he can find.
The hammering is how they find eachother over long distances. Just heard some the other day hammering on my gutter. Went out to scare him off, and lo and behold there were two pairs outside frolicking around in the trees.
A couple years ago I saw one while I was out on my back deck, he started hammering, then about 2 minutes later a female shows up, and they flew off together.
I guess if it's the end of the world the last people will go to the party.