The "snake" consists of mainly carbon that comes from the heated sugar, but which was not burnt in the flame. The carbon is what makes the "snake" black. There is also Na2CO3 in the snake, which results from the decomposition of the baking soda when heated.