Do 5 alpha reductase inhibitor drugs like finasteride and dutasteride lose their effectiveness over time? Why do some drugs, like in an HIV regimen, work for a prolonged time without tolerance whereas other drugs, for example antidepressants, have tolerance issues after a short time?
As noted in a comment, a truly thorough answer to this question would require one or more books (1,2) or scientific journals (3), but a simpler, necessarily incomplete answer can be provided.
The short answer is: transmembrane drug transporters of the ABC family (4)
But what are those? Well, you should read the wikipedia article for a detailed description, but essentially they're proteins that burn energy in order to remove a broad range of drugs from the cytoplasm, making them less "bioavailable". The answer to why some drugs (or broad spectrum treatments with multiple drugs) are more or less susceptible to export by ABC family proteins is much more complicated (buy books from (1) and (2) or similar texts(5)), but the broad spectrum HIV regimen prevents resistance by a completely different mechanism (6).
Briefly, ABC transporter-mediated resistance involves no evolution, simply a "transcriptional response" to the presence of harmful drugs, while HIV actually evolves to become resistant or immune to antiretroviral drugs. However, it's difficult or impossible to be virulent (fast replication) and hardy (drug resistant and/or immune system resistant) at the same time, so mutations which increase resistance to one drug also decrease virulence - if you treat HIV with enough drugs then the mutations required to be resistant to all of them will result in a virus that has very poor virulence.