Well, here is the most widely accepted theory (wiki):
The most widely accepted theory is the so called 'Hunter' Theory according to which transference from ape to human most likely occurred when a human was bitten by an ape or was cut while butchering one, and the human became infected.[2] Researchers announced in May 2006 that HIV most likely originated in wild chimpanzees in the southeastern rain forests of Cameroon (modern East Province) [3] [4] rather than in Kinshasa, Democratic Republic of Congo (formerly Zaire), as had previously been believed. Seven years of research and 1,300 chimpanzee genetic samples led Dr. Beatrice Hahn of the University of Alabama, Birmingham, to identify chimpanzee communities near Cameroon's Sanaga River as the most likely originators. [5]
Calculating based on a fixed mutation rate, the jump from chimpanzee to human likely occurred during the French colonial period (1919–1960).[citation needed] Comparative primatologist Jim Moore suggests that this may have been the result of colonial practices of forced labour, which could have suppressed the immune system of the initial hunter enough to allow the virus to infect and take hold. Likewise, using one needle on many patients for forced immunisations for illnesses such as sleeping sickness may have sped the virus's initial spread through Cameroon. Needles were also shared in the booming colonial city of Kinshasa, where the virus spread.[6]
An elaboration on the "Hunter" theory hypothesises that colonial practices such as labor camps and non-sterile vaccination campaigns, with other technological and social disruptions, to the food supply in particular, promoted the cross-over from chimpanzees and the spread amongst humans.
So, according to this, a hunter was bitten by an ape, or was cut when butchering one, which initiated the infection.