Evolution of animal immunity in the light of beneficial symbioses