It is a truism that antimicrobial drugs select for resistance, but explaining pathogen- and population-specific variation in patterns of resistance remains an open problem. Like other common commensals, Streptococcus pneumoniae has demonstrated persistent coexistence of drug-sensitive and drug-resistant strains. Theoretically, this outcome is unlikely. We modeled the dynamics of competing strains of S. pneumoniae to investigate the impact of transmission dynamics and treatment-induced selective pressures on the probability of stable coexistence. We find that the outcome of competition is extremely sensitive to structure in the host population, although coexistence can arise from age-assortative transmission models with age-varying rates of antibiotic use. Moreover, we find that the selective pressure from antibiotics arises not so much from the rate of antibiotic use per se but from the frequency of treatment: frequent antibiotic therapy disproportionately impacts the fitness of sensitive strains. This same phenomenon explains why serotypes with longer durations of carriage tend to be more resistant. These dynamics may apply to other potentially pathogenic, microbial commensals.