Some flowering crops, such as beans and cotton, carefully manage the amount and sweetness of nectar produced on their flowers and leaves, to recruit colonizing ants which deter herbivores. This strategy balances their needs for defense and reproduction.