This poem is written by Samwise Gamgee and he has possibly based some of the characters on real hobbits. It features a lonely Troll befriending Perry-the-Winkle, a young hobbit. In ~1928 Tolkien wrote an earlier version to this poem called The Bumpus for a series of works.
This is the second poem about the Man in the Moon, also in this one, things are a bit out of control for him when he visits the world, seeking pleasures. According to the preface to the book, the poem is derived from Gondor, based on traditions of men, but here composed by hobbits. There have been many variations of this poem, the earliest being written in 1915. Some of the themes occurs in several of Tolkiens stories, such as the aspect of a Man in the Moon.
This is the first poem out of two featuring the Man in the Moon in this book. There are only two minor differences between this version and the one featured in The Lord of the Rings. An original version can be read in The Return of the Shadow. A revision of that one was published in Yorkshire Poetry in 1923 as The Cat and the Fiddle: A Nursery-Rhyme Undone and Its Scandalous Secret Unlocked. The poem or song is written by Bilbo Baggins.