Predation drives the microbial world, but trophic interactions among microbes are poorly understood. One charismatic predator, the social soil bacterium Myxococcus xanthus, is a model system for studying cooperation and aggregative multicellularity. It has been studied in bi-trophic but never tri-trophic systems, despite the proposed importance for interactions with predators in the evolution of aggregative traits. Given the complexity of natural soil communities, it seems unlikely that a bacterium functions as an apex predator, yet it has rarely been studied relative to its own potential predators and its actual role in its native communities is poorly understood. Our previous work indicates that M. xanthus is considered an unpalatable food source by the nematode Caenorhabditis elegans, suggesting that the bacterium possesses some kind of anti-predator defenses. To investigate this further, we used a novel model food web comprising the bacterivorous nematode Pristionchus pacificus as an apex predator, M. xanthus as a mesopredator, and Escherichia coli as a basal prey to examine how M. xanthus’s social traits adapted to interactions with these two organisms and whether the mesopredator experienced evolutionary tradeoffs in adapting to each. Over the course of an evolution experiment, M. xanthus populations increased in fitness in environments containing E. coli, P. pacificus, or both. Most striking was the clear environment-specific modulation of phenotypes associated with M. xanthus’s well-studied ability to, upon starvation, aggregate into fruiting bodies and sporulate. This suggests that aggregation and fruiting body formation are not simply responses of this bacterium to nutrient levels but may also play a role in defense against predators. Further exploration may yield insights into the evolutionary origin of these traits, as well as provide a bridge to studies of predation avoidance traits in larger organisms.