Pain as an evolutionary necessity