system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why can humans build up a tolerance to some medications but not others?

Edit: Thank you very much for the gold!  I hope the comments made to this post were as helpful to others as they were to me.
gpt
Medications can work in a lot of different ways. One type that is prone to building tolerance are drugs that work in the brain by changing the strength of different chemicals. If a drug increases the effect of one chemical, then it works well at first, but the brain often adjusts one area to compensate for another. The brain might get rid of some of the receptors that are used by that chemical if it decides there is too much of it, making the drug less effective. Sometimes that just means the person needs a dose increase, because usually this balances out and you can still end up with more of that brain chemical than you had before, even after the brain tries to compensate for it.

This is also how drug addiction and withdrawal can work. If a drug causes your brain to reduce activity in an important area, then stopping the drug can leave not enough of it. This is really bad if that chemical helped your brain slow down when it needs to, and that's how withdrawal seizures can sometimes happen.

Other medications work in different ways that don't cause your body to compensate for them and are less likely to lead to tolerance.