When a virus, bacteria, or microorganism no longer responds to a certain drug. Drug resistance can happen with any disease which is why scientists are always fighting to stay one step of HIV.
For more information, visit the National Institute of Health.
https://aidsinfo.nih.gov/understanding-hiv-aids/glossary/212/drug-resistance