Not just pain in the strict sense, but suffering - e.g. spinal muscular atrophy, proteus syndrome, and epidermolysis bullosa are just three genetic horrors of many that need explaining by believers in an all-powerful, benevolent God - and then there is the question of chronic, useless pain.
A scientist looks dispassionately at nature and observes the purpose of pain to be beneficial i.e. It is homeostatic.
If suffering is more than pain then what is the extra? pain and suffering are synonymous in that they are a warning that things are not right.
That is why we research to alleviate that which causes suffering and come up with different answers to different ills.
The question of resolving useless pain is with God.
Where else is the answer to be found. Not in humanism or Atheism which can miraculously go on about the amount of bad in the universe and simultaneously hold that good and bad are relative.