The woodpecker was not actually trying to break the glass. It saw its reflection and thought it was attacking another woodpecker.