The adaptive value of religious ritual