Species from all five kingdoms of life have evolved sophisticated mechanisms to generate diversity in genes that are involved in host-pathogen interactions, conferring reduced levels of parasitism to both individuals and populations. Here, we highlight unifying concepts that underpin these evolutionarily unrelated diversity-generating mechanisms (DGMs). We discuss the mechanisms of and selective forces acting on these diversity-generating immune strategies, as well as their epidemiological and co-evolutionary consequences. We propose that DGMs can be broadly classified into two classes - targeted and untargeted DGMs - which generate different levels of diversity with important consequences for host-parasite co-evolution.