Diamond gives a number of examples of this phenomenon in Chapter 11 of Guns, Germs, and Steel. Over time, some genetic mutations that make people more resistant to certain diseases emerge in populations, and the people who have these immunities are more likely to survive epidemics and pass on these mutations. What this means, as Diamond points out, is that "human populations repeatedly exposed to a particular pathogen have come to consist of a higher proportion of individuals with those genes for resistance," a direct consequence of natural selection. Perhaps the most famous example of this is the frequency of the sickle-cell gene, which, for all of its negative effects, gives its carrier increased resistance to malaria, among African blacks. Two other examples cited by Diamond are the genes for Tay-Sachs and cystic fibrosis, which give some Ashkenazi Jews and Northern Europeans increased immunity to tuberculosis and bacterial diarrhea.
Source: Diamond, Guns, Germs, and Steel, 201.