Woodpeckers peck trees to search for food and to create nesting sites, according to the U.S. Fish and Wildlife Service. They also peck in rapid succession or drum on resonating metal or wood surfaces to establish their territory and to attract mates.
These birds often peck on the wooden siding of buildings because it usually contains wood-boring insect larvae. This is especially true for cedar and redwood siding. They typically drill five or six 1/2-inch holes into siding to get to the insects, which is a behavior that causes a great deal of property damage. The holes are usually in a straight, horizontal line. Some woodpeckers prefer to eat native berries, fruit, nuts and seeds, while sapsuckers feed on the sap of trees in addition to insects.
The drumming that woodpeckers engage in occurs a number of times during the day in the spring. It is important for them to establish their territory because they typically live in the same area year-round. It is difficult to drive them away from their territory once they are established. Woodpeckers live at the edge of wooded areas. When it is time for the birds to reproduce, they build their nests in cavities or holes inside of wooden fence posts, utility poles and buildings, and they typically lay four to eight eggs each time.