Medication has a statistical significant effect, but is often marginal at best, and most of the effect is placebo.
And this assumes an accurate diagnosis, and don't count on that, I have had the head of psychiatric care of a major European capital say to me that the science of psychiatric diagnosis is basically worthless, I wouldn't go that far (the split between research and academia and practice is also a huge problem), but is nowhere as simple as some like to make it seem.
People and lives are often much more complex than that and much more significant factors.
Doctors can also do much more harm than good, locking people up in horribly depressing kafkian institutions because they are suicidal is one of the most insane things I have seen in my life.
Imagine what it feels like being locked up against your will, treated almost like an animal, when you have done nothing to harm anyone, and being told it is "for your own good".