Lycaenids are diverse in their food habits and apart from phytophagy, some of them are entomophagous feeding on aphids and ant larvae. Some of them are also associated with ants and are fed by them. Not all Lycaenidae butterflies need ants, but about 75% of species associate with ants. The term used to describe this is a myrmecophilous relationship. These relationships can be mutualistic, parasitic, or predatory, depending on the species.
In some species, caterpillar are attended and protected by ants while feeding on the host plant, and the ants receive sugar-rich honeydew from them, throughout the caterpillar life. In other species, only the first few instars are spent on the plant, and the remainder of the caterpillar lifespan is spent as a predator within the ant nest. It becomes a parasite, feeding on ant regurgitations, or a predator on the ant larvae.
The caterpillars pupate inside the ant's nest and the ants continue to look after the pupa. Just before the adult emerges the wings of the butterfly inside the pupal case detach from it, and the pupa becomes silvery. The adult butterfly emerges from the pupa after 3-4 weeks, still inside the ant nest. The butterfly must crawl out of the ant nest before it can expand its wings.