"Beans, Beans, The Musical Fruit" (alternately "Beans, Beans, good for your heart") is a playground saying and children's song about how beans cause flatulence (i.e.
[1] The basis of the song (and bean/fart humor in general) is the high amount of oligosaccharides present in beans.
Bacteria in the large intestine digest these sugars, producing carbon dioxide, hydrogen, and methane.
So eat your beans with every meal!
[3] Alternate lyrics include: Beans, beans, the magical fruit.