Throughout "Thanatopsis," alliteration contributes to the poem's eloquence and helps its elaborate sentences hang together.
For instance, in the poem's first sentence, which is eight lines long, /h/ and /v/ alliteration immediately signals to the reader that this is going to be a highly lyrical poem. That is, it's not a poem that tries to mimic everyday speech. Instead, it strives for the most beautiful, interesting, and intricate formulations. So, the first line goes:
To him who in the love of Nature holds
The three /h/ sounds add a sense of cohesion to the phrase's unusual syntax, so that the end of the line calls back to the beginning.
Similarly, the /v/ sounds in the next three lines link three keys ideas, "visible forms," "various language" and "voice of gladness":
Communion with her visible forms, she speaks
various language; for his gayer hours
She has a voice of gladness, and a smile
Though somewhat distant from each other, these repeated /v/ sounds clearly link these ideas, emphasizing how the sentence stretches out as it follows a train of thought. Taken all together, this repetition emphasizes nature's visibility, variety, and voice.
Sometimes, alliteration acts on a smaller level, making individual phrases more vivid. For instance, "Rock-ribbed" in line 39 has rocky, repeating /r/ sounds that suggest the repeating rib-like stones in the hills. Five lines later, "Old Ocean" conjures the elderly, personified ocean. It's repeating /o/ sounds might almost be cute, if the ocean weren't also a "gray and melancholy waste." Instead, the alliteration suggests the orneriness of "Ocean" as a figure.
In lines 49-53, alliteration acts almost like rhyme. End words begin with same sound: "tread," and "tribes" in lines 59-50; "wings," "wilderness," and "woods" in 51-53. This stretch of sounds helps add variety to the very long third stanza. Furthermore, like rhyme, it links words together. It is the "tribes" who "tread" over the earth, and morning's "wings" help one fly through the "wilderness" and "woods." The sentence that begins in line 51 doesn't end till line 58, so these rhyme-like alliterations helps add a sense of order to an otherwise tangled sentence.
In lines 56-57, a quick succession of /s/ and /f/ sounds captures the swift passing of time:
[...] in those solitudes, since first
the flight of years began
Coupled with the steep enjambment, this quickness helps summon the "flight of years," as if the words themselves are about to zoom off the page.
Throughout the poem, then, alliteration adds to the language's vividness and sense of order.