Lycaenids are diverse in their food habits and apart from phytophagy, some of them are entomophagous feeding on aphids, scale insects, and ant larvae. Some Lycaenids even exploit their association with ants by inducing ants to feed them by regurgitation, a process called trophallaxis. Not all Lycaenid butterflies need ants, but about 75% of species associate with ants,[5] a relationship called myrmecophily. These associations can be mutualistic, parasitic, or predatory depending on the species.
In some species, larvae are attended and protected by ants while feeding on the host plant, and the ants receive sugar-rich honeydew from them, throughout the larval life. In other species, only the first few instars are spent on the plant, and the remainder of the larval 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.[5] 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.
Several evolutionary adaptations enable these associations and they include small glands on the skin of the caterpillars called pore cupola organs. Caterpillars of many species except those of the Riodininae have a gland on the 7th abdominal segment that produces honey dew and is called the dorsal nectary gland (also called Newcomer's gland). An eversible organ called the tentacular organ is present on the 8th abdominal segment (third segment of thorax in the Riodininae) and this is cylindrical and topped with a ring of spikes and emits chemical signals which are believed to help in communicating with ants.[8]
As many as 98% of world's threatened butterflies are lycaenid.[citation needed]