Density-dependent mutualisms have been well documented, but the behavioral mechanisms that can produce such interactions are not as well understood. We investigated interactions between predatory ladybirds and the ant Lasius neoniger, which engages in a facultative association with the aphid Aphis fabae. We found that ants disrupted predator aggregation and deterred foraging, but that this effect varied with aphid density. In the field, smaller aphid colonies had higher numbers of ants per aphid (higher relative ant density), whereas plants with larger aphid colonies had lower relative ant density. Ants deterred ladybird foraging when relative ant density was high, but when relative ant density was low, ladybirds aggregated to aphids and foraged more successfully. This difference in ladybird foraging success appeared to be driven by variation in the ants' distribution on the plant and the ladybirds' reaction to ants. When relative ant density was high, ants moved around the perimeter of the aphid colonies, which resulted in faster detection of predators and a greater likelihood of ladybirds leaving. However, when relative ant density was low, ants moved only in the midst of the aphid colonies and rarely around the perimeter, which allowed predators to approach the aphid colony from the perimeter and feed without detection. Such predators were less likely to leave the aphid colony when subsequently detected by ants. We suggest that differences in relative ant numbers, ant distribution, and predator reaction to detection by ants could lead to complex population-level consequences including density-dependent mutualisms and the possibility that predators act as prudent predators.