This post will focus on the mechanism by which a cell fights against HIV, mainly by interfering with its life cycle. There are only 3 such mechanisms discovered and elucidated till date.
As it says on the post, these are innate mechanisms most of which are upregulated by Interferons (alpha and gamma).The adaptive immune system is mostly ineffective against retroviruses. How? Earlier the most accepted hypothesis was that this is because of error-prone Reverse trancriptase which makes a lot of errors while forming the proviral ds DNA, hence causing hypermutations(mainly G to A) resuting in change in the viral antigenic domains. This is true for both HIV and HBV.
1. APOBEC3G: The full form is Apolipoprotein B mRNA editing enzyme and catalytic polypeptide like 3g which you will easily forget and you should. It is basically a cytidine deaminase which acts on the negative cDNA strand and converts dC into dU; hence converting G into A in the positive strand. These hypermutations ultimately lead to failure of viral replication by unknown processes. So the latest most accepted hypothesis explaining the G to A hypermutations in virion DNA is this. This is more effective against HBV than HIV, guess why? Its because HIV-1 has Vif (Viral Infectivity Factor) that inactivates APOBEC3G.
2. TRIM5: This is the reason why Rhesus monkeys are innately resistant to HIV. Its an awesome protein in my opinion. What it does is as soon as the viral nucleocapsid enters the cell, it forms a cage around it and cause it to "uncoat" prematurely hence inactivating the reverse transcriptase and other enzymes present within the capsid. Then it performs a Kamikaze!
It ubiquitinates itself (auto-ubiquitination); hence causing its own proteasomal degradation and destroying the viral proteins in the process as collateral damage.
3. Tetherin: Now this is a case of Stockholm Syndrome! Tetherin are proteins that tethers or chains the virion to the cell membrane, hence preventing its release from the cell. The cell is not letting the virus leave her. So that when the cell dies either by apoptosis or inflammatory processes, the virions die with it. <3
Unfortunately however cool these may appear, these are mostly ineffective and hence the standard microbiology textbooks choose to ignore these proteins. Hopefully in future, drugs will be designed to make them more effective. :)