There was a recent question about what to do about a woodpecker that was drumming on a customer’s house. I found some good information to offer understanding on this behavior from the Cornell Laboratory of Ornithology.
“Q. Why do woodpeckers like to hammer on houses? And what can I do about it?

A. Woodpeckers usually hammer on houses for one of four reasons:

1)Because it makes a satisfyingly loud noise that proclaims the bird’s territory and attracts a mate. If the birds are drumming for these reasons, they will most likely stop once breeding has begun in the spring (they don’t drum when looking for food).
2)Because the bird wants to excavate a nest or roost hole. If the woodpeckers are creating a nest cavity, the hole will be round and large. Nesting holes are usually built in the beginning of the breeding season between late April and May. If you need to evict woodpeckers from your home, aim to do so either before or after the nesting season.
3)Because it is feeding on insects living in the siding. If the birds are looking for insects, the holes will be small and irregular. You may have to call an exterminator to get rid of the underlying insect problem. Woodpeckers are particularly fond of the larvae of carpenter bees, leafcutter bees, and grass bagworms.”
Here is a link that will offer additional information.

Woodpecker Control