All papilionid caterpillars carry an osmeterium, a fleshy Y-shaped organ folded inside a pocket behind the head. When the larva is prodded it rears up and everts the organ within a fraction of a second, exposing a bright orange or yellow fork and releasing volatile compounds. The organ retracts once the disturbance ends.
The secretion is chemically active, not merely smelly. In mature Papilio machaon larvae, which feed on carrot-family plants, it is dominated by aliphatic acids, chiefly isobutyric and 2-methylbutyric acid; papilionid larvae feeding on citrus and rue produce terpenes instead. Younger machaon larvae also produce terpenes, so the mixture shifts with instar as well as with host family. Trials show the secretion deters ants and other small invertebrates, and some vertebrates at close range, though a bird already committed to an attack is less easily deterred.
The British population, subspecies britannicus, is a strict fen specialist whose larvae feed almost exclusively on milk-parsley, and it is confined to the Norfolk Broads. Continental machaon reaching Britain occasionally are the wider-ranging form and are not the same subspecies, a distinction often blurred in casual reports.

