• Anal secretions;
  • antipredator;
  • birds of prey;
  • Carnivora;
  • predation risk;
  • sociality

Mammals have evolved several morphological and behavioral adaptations to reduce the risk of predation, but we know little about the ecological factors that favor their evolution. For example, some mammalian carnivores have the ability to spray noxious anal secretions in defense, whereas other species lack such weaponry but may instead rely on collective vigilance characteristic of cohesive social groups. Using extensive natural history data on 181 species in the order Carnivora, we created a new estimate of potential predation risk from mammals and birds of prey and used comparative phylogenetic methods to assess how different sources of predation risk and other ecological variables influence the evolution of either noxious weaponry or sociality in this taxon. We demonstrate that the evolution of enhanced spraying ability is favored by increased predation risk from other mammals and by nocturnality, but the evolution of sociality is favored by increased predation risk from birds of prey and by diurnality, which may allow for enhanced early visual detection. These results suggest that noxious defenses and sociality are alternative antipredator strategies targeting different predator guilds under different lighting conditions.