Not sure if this is 100% accurate, but it seemed interesting: supposedly this is because these caterpillars have are vulnerable to a type of fly that likes to attack them when they're basking. The fly glues it's eggs to the caterpillars' heads, and the maggot eventually burrow inside the caterpillar, killing it. As a result/defense-mechanism tthey react to frequencies similar to that of the fly, causing them to shake about violently to discourage egg-laying
'
https://amp.nine.com.au/article/d0a1766d-2e59-4857-8fcf-6d88faa094df
'
https://amp.nine.com.au/article/d0a1766d-2e59-4857-8fcf-6d88faa094df