At the beginning of "Thanatopsis," the speaker is experiencing happiness ("gayer hours") and this prompts a very specific reaction from Nature, who is personified as a female friend. First of all, Nature's voice is full of "gladness," which means that it is happy, light, and upbeat. In addition, she smiles a lot and her natural beauty is very obvious and apparent.
When the speaker is happy, Nature also moves in a very specific way: she "glides," for example, and is able to penetrate his darker thoughts ("musings") and make their "sharpness" go away. In other words, she neutralizes his bad thoughts and turns them into good. She therefore possesses the power of healing.
In essence, Nature reacts to the speaker's mood: when he is happy, she acts in a way to prolong this feeling and, when he starts to feel sadness, she intervenes to take his negative thoughts away.