If “intelligence” is just the degree/quality of someone’s brain function then your intelligence does drop when your brain function is impaired, and you would expect that to be picked up in an intelligence test.
Culturally we may want to imagine intelligence as something constant and innate to somebody’s soul, but in reality it’s innate to a fragile and fickle organ inside your skull.
Which is also my issue with IQ tests and the relationship of the tests and what they measure. But that changes nothing: IQ tests are not supposed to measure _that_ variability of when you get sick. Or you wake up. Or you are drunk. It makes no sense to use a psychometric test completely out of the context of which it was validated and meant to be used, because then the results are not interpretable. People with that kind of post-covid syndrom have an illness and experience cognitive deficits because of that, but using IQ to measure intelligence in that case when what you actually (want to) measure is brain fog is absurd. That should require a brain fog screening, not an IQ test.
I always assumed it was because there are people born with impaired intellectual abilities, and having some measure of how impaired they are would be significant for things like edibility for benefits and management of their condition (e.g. goals for the school system).
If I do one sober, I have an IQ of 110, if I do it with my ADHD meds, it goes up to 120.
Is that because the meds make me smarter? No, it's because I don't lose attention after 10 minutes of test and can concentrate until the end. However, the numbers imply otherwise.
At some level, IQ tests measure your ability to take IQ tests. So it would make sense that your measured IQ would go up when you're on ADHD meds, since those will obviously have an effect on your ability to take IQ tests.