Chickens have found a niche that ensures their survival as a species that in the mere twenty-thousand or so years it has been around that has elevated them just another humble bird living in the forests of India to spreading across the entire globe. The simple secret to the success of this species success is providing tasty eggs and being being tasty to humans.
Of course, for individual chickens this mostly doesn't work out too well, but it unambiguously has allowed the species to flourish in a way it would not have otherwise. There is the argument that it is not a "natural" niche because it is dependant on humans, but that presumes that our species is somehow "unnatural", which is a premise that I reject. We evolved into what we are and to do what we do just the same as every other animal.