An earlier post describes how the caterpillar weaves a tiny pad on the underside of the leaf before attaching itself and slowly turning into a pupa.
Subsequent handling of pupal cases and pupae showed that the tiny pad of silk that the pupating caterpillar clings to is supported by a wide expanse of silk laid on the leaf surface (above). This expanse of silk extends to the other surface if the pad is near the edge of the leaf (below left). In the case of a horizontal twig, the supporting silk is laid around the twig (below right).
This ensures that the pupa does not get easily detached as it swings vigorously during its subsequent development.
The video above shows the pupating caterpillar laying silk on both sides of the leaf where the future pupa will finally attaches itself on.