The effect was found in people regardless of whether or not participants had a mental health disorder. The study was an analysis of data from 16 previously published studies with a total of 922 participants who were randomly assigned to do resistance training or be inactive. There are likely multiple mechanisms at play here. It is known that exercise (both aerobic and non-aerobic) causes branched chain amino acids to be taken up into muscle cells. This alleviates competition with tryptophan for transport into the brain thus allowing tryptophan to be converted into serotonin. This is why exercise increases serotonin. Exercise also decreases inflammation which has been shown to play a causal role in depression and anxiety. Go get some exercise today!