I partly agree with Mike, but even without the outside caramelising, the substance amounts to a very viscous fluid. As it heat up it produces bubles of steam and other gases, and of course the bubbles can't escape. So the result is a bubbly foamy texture.
Many substances produce similar effects. I remember experimenting with thick nylon filaments when I was a child. They also foamed in more or less the same way, but with more charring. My experimentation did not extend to tasting the product though. The smell was quite enough.