Parasitoid larvae, probably from a wasp, have emerged from the black wounds of this caterpillar, perhaps a hesperidae butterfly, and pupated.
Check out the trachea (the branching gas exchange organs observed through the skin of the caterpillar) and the punctures from the larval exits!