They're being intensively studied, of course. It may just be luck. Some people survived bubonic plague in the 14th century, too. But the odds were poor - it killed a quarter of Europeans in three years. With Aids, if you are a black person from Southern Africa, the odds against you seem to be particularly bad - see below.
Aids comes from grey monkeys.
I don't know how this weird one got started here, but it's actually partially correct. But HIV-2, the biggest killer in far West Africa, comes from an SIV in sooty mangabeys, which are eaten there. A sooty mangabey is, literally, a grey monkey. Your Aids risk is from sex. There's a miracle cure.