Many viruses get away by constantly changing itself. If the key of our immune systems is to find a matching key, imagine what would happen if a locksmith is trying to open a lock while the lock itself keeps changing. So our immune system always lags behind a little. That's why we still don't have an effective way of curing something so simple like a common flu and so terrible like HIV. Doesn't matter what drug you come up with, the virus keeps changing! That guarantees some, however small, population of the virus will survive. And give it a couple days/months and millions of generations of viruses, you will have another pandemic in your body.
That's where vaccine comes in. We are introduced with a small population of either dead whole viruses or parts of viruses. This way, we won't get sick while giving our body a chance to manufacture "labeling cells" that match the virus. And our body would then store these matching cells for rainy days. The idea is that we would have these matching cells ready to label viruses as soon as they attack and give them no chance to mutate. The difficult part of this, in the case of flu virus, is that there are hundreds of types of flu virus and we have to have matching cells for each type of them. that's why we have to get flu shots every year. Another problem is that these stored matching cells have shelf life and expire from time to time.
The problem with HIV is that it changes so fast and it's a retrovirus, meaning it injects its own RNA into our own cells. Then our own ells turn these RNA into DNA, which combines with our our own DNA. Then WE ourselves start pumping out viruses. Even if you kill the actual virus, the viral DNA is already in us, much like in the movie "Alien".
One key step in viral infection is the fusion of viral membrane with host cell membrane, which then allows the virus to dump its RNA into host cells. A major trend in the field is to figure out a way to stop this fusion. Of course the problem with this strategy is that you can't simply stop all membrane fusion, which is a vital part of cell metabolism. You stop fusion, all of our own cells will die and that's not good. So the key is to find the kind of fusion process that's unique to viruses. We actually did some theoretical work on the the process of membrane fusion and it's not as easy as previously thought...
Sorry about the long post. I get excited whenever people talk about this stuff