The caterpillars below have likely consumed all available resources in one place and are moving together to find more food or pupate. The video isn’t well focused, but it does illustrate the pile of caterpillars moving as one ‘slug’ across the stair.
They could also collectively fleeing a predator.
Interesting.
The first thing I thought of when seeing these caterpillars was the aggregate amoeba ‘slugs’ that form when unicellular amoeba come together to sexually reproduce and sporulate. How do these aggregates navigate!?