How does regular exercise improve mental health and reduce symptoms of anxiety and depression?

How does regular exercise improve mental health and reduce symptoms of anxiety and depression?