Poems and songs were a common motif in both the novel and film versions of The Lord of the Rings. In both J. R. R. Tolkien's novel and Peter Jackson's film adaptations, poems and songs were often interchangeable. For example, in the chapter "A Conspiracy Unmasked" from Tolkien's The Fellowship of the Ring, Pippin referred to one of Frodo's songs as poetry. Jackson often set Tolkien's poetry to music to make it even more interesting and memorable. In the real world, poems and songs were some of the oldest forms of storytelling; before the invention of writing, cultures passed down their stories through oral traditions.
Source:https://www.cbr.com/lord-of-the-rings-poetry-exciting/