High mutation rates are generally considered to be detrimental to the fitness of multicellular organisms because mutations untune finely tuned biological machinery. However, high mutation rates may be favoured by a need to evade an immune system that has been strongly stimulated to recognize those variants that reproduced earlier during the infection. HIV infections conform to this situation because they are characterized by large numbers of viruses that are continually breaking latency and large numbers that are actively replicating throughout a long period of infection. To be transmitted, HIVs are thus generally exposed to an immune system that has been activated to destroy them in response to prior viral replication in the individual. Increases in sexual contact should contribute to this predicament by favouring evolution toward relatively high rates of replication early during infection. Because rapid replication and high mutation rate probably contribute to rapid progression of infections to AIDS, the interplay of sexual activity, replication rate, and mutation rate helps explain why HIV-1 has only recently caused a lethal pandemic, even though molecular data suggest that it may have been present in humans for more than a century. This interplay also offers an explanation for geographic differences in progression to cancer found among infections due to the other major group of human retroviruses, human T-cell lymphotropic viruses (HTLV). Finally, it suggests ways in which we can use natural selection as a tool to control the AIDS pandemic and prevent similar pandemics from arising in the future.