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.