The effect of depression, anxiety, and a host of other mental illnesses is that they prevent you from taking steps to address the addressable issues in your life. To start exercising while depressed, to start socializing while suffering from anxiety, etc., are some of the hardest things to do. That’s why medication is typically paired with counseling - the medication prepares you to take the steps the counseling guides you into taking.
To put it another way, anxiety disorders (and depression, and ADHD, and more) take away agency. The purpose of medication is to reintroduce agency. The medication (for most people) won’t fix their problems, but it will help them fix them.