This is a nonsensical poem composed by Samwise Gamgee and it is also found in The Lord of the Rings. Earlier versions by Tolkien called the poem Pero & Podex or Root of the Boot and had been written/published between 1920-1936.
For the second poem in this publication, Tom is yet again the main character. This time the reader follow him on a boating trip along the Withywindle and his journey to meet Farmer Maggot. In this story we encounter familar places in Buckland and the Shire. The idea is that the events set out occured some time after Frodo and the other Hobbits visited Farmer Maggot and Tom Bombadil and that the poem is composed by Buckland hobbits.
The title character of this book is none other than Tom Bombadil, who is featured in this poem. It is supposed to reflect poetry written by/being told by Hobbits in Buckland, who would be fairly well aquaintanced with Tom Bombadil, although they might not understand him perfectly. The poem have a fairly early origin, being concieved long before Frodo and his company meet Tom.
The Adventures of Tom Bombadil and Other Verses from the Red Book contains 16 poems, each with their own plot. It was first published in 1962. I have read a 2014 edition of the book, edited by Christina Scull and Wayne G. Hammond. It contains extra content, such as earlier versions of the poems, and commentary.