Many invertebrates go through a process called ecdysis. Taken from the ancient Greek the word means, literally, to strip off. It leaves behind an exuviae, the remains of the exoskeleton which has been shed, often with related structures still attached.
For some invertebrates it can be a regular occurrence to facilitate growth. For others it can be part of a series of instars which culminate in the emergence of the finished, adult form. It is a fascinating process where beauty can be found in the grotesque.