It spits out a fluid that it uses to glue tree bark to its body. The fluid hardens when it touches air.
It likes to make its shell thicker by adding layers of tree bark. The additional weight doesn't bother it.