How do you know it was a pest? Have you noticed any damage? I can’t tell much from the first picture, but in the second picture it looks like many of your eggs have legs. So those might be thrips. Those are definitely pests.
I just guess they are pests at this moment, but the soft caterpillar like worms generally are not good.
One can see there are some brown spots on this eggplant, while other eggplants have no such spots.
I agree, there are definitely a lot of aphids on the leaves. The worm like things might actually be ladybug larvae, but I can’t tell from the picture. I don’t spray anything for aphids anymore, since I’ve gotten enough of a ladybug population in my gardens that they keep them in check. So definitely make sure they things you’re putting on the rock are bad before squishing more.