It’s nature for chickens and a lot of other birds to ‘peck’ - (I don’t know about chickens - they may come into the world pecking - but when you hand-raise a lot of wild birds, they have to learn pecking from you, as they would from Mother Bird.)
Birds peck at things that they think might be food.
If one chicken in the flock gets a sore the other chickens will peck at the sore until the chicken with the sore dies.