Cooperative benefits depend on a variety of ecological factors. Many cooperative bacteria increase the population size of their groups by making a public good available. Increased local population size can alleviate the constraints of kin competition on the evolution of cooperation by enhancing the between-group fitness of cooperators. The cooperative pathogenesis of Agrobacterium tumefaciens causes infected plants to exude opines—resources that provide a nearly exclusive source of nutrient for the pathogen. We experimentally demonstrate that opines provide cooperative A. tumefaciens cells a within-group fitness advantage over saprophytic agrobacteria. Our results are congruent with a resource–consumer competition model, which predicts that cooperative, virulent agrobacteria are at a competitive disadvantage when opines are unavailable, but have an advantage when opines are available at sufficient levels. This model also predicts that freeloading agrobacteria that catabolize opines but cannot infect plants competitively displace the cooperative pathogen from all environments. However, we show that these cooperative public goods also promote increased local population size. A model built from the Price Equation shows that this effect on group size can contribute to the persistence of cooperative pathogenesis despite inherent kin competition for the benefits of pathogenesis.