Hens lay many eggs during their lifetime (at least, I don't know of one which can lay more eggs) and they can't fly. Compared to other domestic animals it seems to me they are the least capable of defending themselves or escape if it comes to be left alone in open wild. What is their evolutionary story?
Domestic organisms are bred to serve specific purposes for humans. Sheep are bred to produce wool; Cows are bred to provide meat and milk for human consumption; dogs are bred for service and companionship. Since domestic animal do need to survive in the wild in order to reproduce (ignoring feral animals, which is an interesting topic by itself), most of the other aspects of that animal relevant to its survival tend to be minimized.
So one could just as easily point out that there is no other animal that produces as much wool as a sheep, and yet producing copious amounts of wool isn't particularly useful to the animal itself (i.e. other than the fact that humans will tend to select good wool producers for breeding). So sheep are not particularly good at surviving in the wild, and yet they are incredibly successful as a species and are widely distributed, thanks to humans.
In short, domestic hens evolved to produce many eggs in their lifetime because over the past millennia since humans have started keeping them as livestock, humans tended to preferentially breed those individuals which produced more eggs and to eat those individuals which did not. Chickens tended to be kept in pens and guarded by humans or other animals, so the ability to defend themselves or flee from danger was not important to their survival, and in fact, those that did attack their handlers or escape were probably less likely to be bred.
This process is known as selective breeding or artificial selection.