HIV jumped from primates to humans fairly recently, only becoming a major issue in the 20th century. Yet it turns out that the virus's "primate precursor is very old," perhaps "tens of thousands of years old," according to researchers, who have been studying the primate virus (called SIV) in an isolated population of West African monkeys to judge its age. "This brings back the big question," writes Discover's Andrew Moseman, reviewing the study:

If SIV has been circulating in Africa's primates for that long, (and humans have been butchering primates all along), then what was so different about the mid-20th century that allowed it to hop into humans and spread through the population as lethal HIV?
Scientists have ideas, but no definitive answer. Some think the "key factor" was the jump in human use of needles. One virologist, as Moseman notes, says it was more likely tied to the rise of cities:

It's possible that before that rampant urbanization, human hunters exposed to primate blood contracted the virus. However, without the interconnectedness of modern society, they probably died before they could spread the virus too far.

The mystery remains.