|Young cellar spider's cast-off leggings and T-shirt, hung out to dry.|
Immature spiders molt frequently; they've got a lot of growing to do, from pinprick spiderling size to fat adult. This one was about half-grown, a spider teen. Well-fed, so he grew out of the leggings while they were still new-looking.
To shed the old exoskeleton, the spider has to bust out from the inside. It increases its heart rate to pump a lot of hemolymph (the spider's blood) from the abdomen into the cephalothorax. The pressure expands the cephalothorax, which pushes on the old exoskeleton until it cracks. The spider flexes its muscles until the old exoskeleton falls away. (HowStuffWorks)
One of my crabs molted this morning, too; I found the old carapace and legs up against the glass. When I returned with the camera, after morning chores, it was gone. The hermit crabs collect these, break them up, and clean out any edible remains. The remaining chitin is eaten by bacteria; starfish and certain fish can also digest it.
I don't know what, if anything, eats old spider molts. Something must; in nature, nothing is ever wasted.