Why do woodpeckers peck holes in wood?

It makes holes so that it can use its barbed tongue to grab bugs inside the tree.