Your situation includes yourself, where you are, what you do every day, who you are around, etc. Usually it hasn't changed much in years. It's very fixed, very rigid, very limited. But you've seen it everyday for years so it's kind of your total picture of life.
If your situation is bad, you don't view it as one among many possibilities. You view it as life generally - this is just how things are and there's no other options that are meaningfully different. This persisting for years erodes your mental health.
However when you travel (properly, meaning solo, for a significant duration, with a big chunk of it away from tourist areas), you realize on a visceral level the following things that you had no experiential knowledge about: the world is huge and massively varied, people and cultures are massively varied, and ways of living are massively varied.
Concurrently, displaced from your original situation, not seeing the people or places, not doing the routines, being thousands of miles aways, all the bad feelings start slowly draining out of your body. Like you've just stepped out of being in a sauna for years and now you're slowly cooling down and remembering what feeling cool is like.
The result of this is affectively that you come to realize at a visceral psychological level that misery is optional, and there are thousands of other options - you've just seen and experienced them first hand.
IMHO, people going and getting drugged up to deal with the misery, instead of doing this, is profoundly wrong. I think a lot of it is crabs in the bucket - those around them have a vested interest in holding them in place, selfishly treating their misery as irrelevant, and so will do everything in their power to prevent them taking such an action. Your change isn't good for them.
But yeah, maybe isn't for everyone, but in my opinion, for anyone who's been suffering mental health issues in adulthood (remember how you didn't during childhood? - different situation), this is an obvious first port of call.