Bacteria and their viral predators (bacteriophages) are locked in a constant battle. In order to proliferate in phage-rich environments, bacteria have an impressive arsenal of defence mechanisms, and in response, phages have evolved counter-strategies to evade these antiviral systems. In this Review, we describe the various tactics that are used by phages to overcome bacterial resistance mechanisms, including adsorption inhibition, restriction-modification, CRISPR-Cas (clustered regularly interspaced short palindromic repeats-CRISPR-associated proteins) systems and abortive infection. Furthermore, we consider how these observations have enhanced our knowledge of phage biology, evolution and phage-host interactions.