I was trying to chase down some specific info on this subject to accompany these shots that I took a few days ago, but haven't managed to find what I was after. So I'll post them with just a short explanation.
What you're seeing are the larvae - caterpillars - of the Imperial Blue butterfly, Jalmenus evagoras being fussed over by ants. The ants get a heap of nutritious substances which are exuded especially for them by the caterpillars (and, from memory, some drug-like substances that modify their behaviour), and in return these ants will quickly dispatch of anything that comes near their defenseless charges or even lands nearby on the plant (Acacia decurrens, the Sydney Green Wattle in this case, though A. longifolia is another favourite).
The attention given by the ants seems to reach a frenzied peak leading up to pupation, and the ants even protect pupae quite vigorously.