A history of antagonistic interactions within and between species can provide trait variation on which social and mutualistic evolution can subsequently act. Insects that feed on plants provide many examples of cooperation-out-of-conflict, and thus illustrate important principles about the evolutionary process. I will discuss how two groups of gall-forming insects have evolved social and mutualistic interactions on plants. In one, lateral gene transfer may have facilitated a mutualism between gall midges and phytopathogenic fungi on their host plants, Solidago spp. In the other, a gall-forming aphid, the ability to secrete factors that disrupt the immune responses of natural enemies may be a key innovation that facilitates sociality in this group. (#27728)