Infection with the human immunodeficiency virus (HIV) results in severe damage to the immune system and consequent disease (AIDS) after a long and variable incubation period (on average 8-10 years). Why the incubation period should be so long is a puzzle. We outline an explanation based on the dynamics of the interplay between the immune response and antigenic variation in the virus population. The essential idea is that AIDS results when the diversity of antigenic variants of HIV in an infected patient exceeds some threshold, beyond which the immune system can no longer cope. The paper develops a simple mathematical model for this process, based on experimental observations, and explores several ramifications.