Hello from JustAnswer.
It is more than just a theory, although you are correct that it is difficult to measure these chemicals in a live human brain to verify some of the specific information.
Historically, there were several medicines that were discovered to help depression and other mental health disorder long before it was understood how the medicines worked. For example, the early tricyclic antidepressants were actually developed as antihistamines, and while being tested as an antihistamine for allergies, it was discovered that the patients that were also depressed frequently noticed an improvement in the depression. It was only many years later that analysis in the lab and animal studies showed that the tricyclic antidepressants affect serotonin and norepinephrine levels and dopamine to a lesser extent, in addition to the antihistamine properties. Then there was an effort to develop a drug that would only affect serotonin in the brain, again based on lab and animal studies, but these drugs were very effective at treating depression in humans and evolved into the SSRIs that are the most commonly used antidepressants.
For other drugs used for mental health conditions, there is similar lab and animal studies that indicate the brain chemicals that are affected by the drugs.
Ultimately, any drug that is developed for a mental health condition is only known to actually help because of clinical studies that improve the clinical symptoms.
It is hoped that we will develop technology in the future that will allow for measurement of these chemicals in the brain, but it clearly is not yet at this level.
If I can provide any clarification, please let me know.