When a species of nightshade is injured by hungry beetles, it produces sugary nectar at the wound site. The nectar attracts ants that then keep the beetles at bay.