During social evolution, ants have adapted their social lifestyle by developing an efficient division of labour and defending their societies against endo- and social parasites. They have evolved many different lifestyles, from the small Temnothorax colonies consisting of only a few dozen individuals to the multi-million member societies of leafcutter ants, from altruistic behaviours to various forms of social parasitism. Social insects are prime examples of phenotypic plasticity and can respond dynamically to changes in their social environment. We will present results on the evolution and molecular regulation of the complex behaviours of Temnothorax ants, including how parasites manipulate their behaviour. We demonstrate that ants infected with a parasitic cestode are not only less active, but also do not flee when attacked, which facilitates transmission to the final host, woodpeckers. These parasitized ants also live much longer, and we investigate the release of parasitic proteins into the haemolymph of infected ants, the functions of which are related to lifespan extension, and changes in behaviour and gene expression. We show that the division of labour between workers is associated with differential gene expression mainly in the antennae and less in the brain. Indeed, brood care behaviour is controlled by a candidate gene, vitellogenin-like A, whose RNAi-mediated down-regulation leads to differential responsiveness to social (chemical) cues, suggesting an important role of olfaction in regulating task division. We reveal how these ants have evolved complex defence portfolios against the raids of socially parasitic ants and which behavioural and molecular changes have enabled the evolution of these fascinating parasitic lifestyles.