Did you watch the video? There is an explanation on that, but I'll post the information that was posted prior to the video.
http://clayruth.com/pupa.html"The pupation process is fascinating to watch. Initially, the larva is suspended by its rear legs, whose tiny claws are embedded in a silk button that the larva has spun on its chosen support. These legs are part of the skin, which the pupa must now remove. The larval skin is delicately attached to the pupal skin in the area between the last two pairs of legs. As the hanging caterpillar wriggles, the larval skin splits behind the head and is gradually pushed upward toward the point of suspension. When the skin is all bunched up at the top, the pupa flexes to one side, withdrawing a spiny black stem from under the skin. Without the benefit of eyesight, the pupa skillfully thrusts the stem into the silk button, entangling its many tiny spines in the silk. It then gyrates wildly, breaking the bond between the larval and pupal skins that had supported it before, and drops the larval skin to the ground. It flexes a few more times to ensure that the skin is gone, then settles down to become a smooth chrysalis."