Depression can be seen as protection mechanism that reinforce rigid thought patterns in order to avoid runaway (psychosis, mania). So anything tiping the balance in the other direction allows to deprogram those behaviors.
This is related to the "entropic brain" theory, see https://www.frontiersin.org/articles/10.3389/fnhum.2014.0002...