Infection of more than one virus in a host, coinfection, is common across taxa and environments. Viral coinfection can enable genetic exchange, alter the dynamics of infections, and change the course of viral evolution. Yet, the factors influencing the frequency and extent of viral coinfection remain largely unexplored. Here, employing three microbial data sets of virus-host interactions covering cross-infectivity, culture coinfection, and single-cell coinfection (total: 6,564 microbial hosts, 13,103 viruses), I found evidence that ecology and virus-virus interactions are recurrent factors shaping coinfection patterns. Host ecology was a consistent and strong predictor of coinfection across all three datasets: potential, culture, and single-cell coinfection. Host phylogeny or taxonomy was a less consistent predictor, being weak or absent in potential and single-cell coinfection models, yet it was the strongest predictor in the culture coinfection model. Virus-virus interactions strongly affected coinfection. In the largest test of superinfection exclusion to date, prophage infection reduced culture coinfection by other prophages, with a weaker effect on extrachromosomal virus coinfection. At the single-cell level, prophages eliminated coinfection. Virus-virus interactions also increased culture coinfection with ssDNA-dsDNA coinfections >2x more likely than ssDNA-only coinfections. Bacterial defense limited single-cell coinfection in marine bacteria CRISPR spacers reduced coinfections by ~50%, despite the absence of spacer matches in any active infection. Collectively, these results suggest the environment bacteria inhabit and the interactions among surrounding viruses are two factors consistently shaping viral coinfection patterns. These findings highlight the role of virus-virus interactions in coinfection with implications for phage therapy, microbiome dynamics, and viral infection treatments.