HIV is thought to have occurred after people ate chimps that were carrying the Simian Immunodeficiency Virus (SIV).
HIV is a type of lentivirus, which means it attacks the immune system. SIV attacks the immune systems of monkeys and apes in a very similar way. This suggests HIV and SIV are closely related, and that SIV in monkeys and apes crossed over to humans to become HIV.