The soldier caste has anatomical and behavioural specializations, providing strength and armour which are primarily useful against ant attack. The proportion of soldiers within a colony varies both within and among species. Many soldiers have jaws so enlarged that they cannot feed themselves, but instead, like juveniles, are fed by workers. The pantropical subfamily Nasutitermitinae have soldiers with the ability to exude noxious liquids through either a horn-like nozzle (nasus). Simple holes in the forehead called "fontanelles" and which exude defensive secretions are a feature of the family Rhinotermitidae. Many species are readily identified using the characteristics of the soldiers' heads, mandibles, or nasus. Among the drywood termites, a soldier's globular ("phragmotic") head can be used to block their narrow tunnels. Termite soldiers are usually blind, but in some families, particularly among the dampwood termites, soldiers developing from the reproductive line may have at least partly functional eyes.
The specialization of the soldier caste is principally a defence against predation by ants. The wide range of jaw types and phragmotic heads provides methods that effectively block narrow termite tunnels against ant entry. A tunnel-blocking soldier can rebuff attacks from many ants. Usually more soldiers stand by behind the initial soldier so once the first one falls another soldier will take the place. In cases where the intrusion is coming from a breach that is larger than the soldier's head, defense requires special formations where soldiers form a phalanx-like formation around the breach and bite at intruders or exude toxins from the nasus or fontanelle. This formation involves self-sacrifice because once the workers have repaired the breach during fighting, no return is provided, thus leading to the death of all defenders. Another form of self-sacrifice is performed by Southeast Asian tar-baby termites (Globitermes sulphureus). The soldiers of this species commit suicide by autothysis—rupturing a large gland just beneath the surface of their cuticle. The thick yellow fluid in the gland becomes very sticky on contact with the air, entangling ants or other insects who are trying to invade the nest.
Termites undergo incomplete metamorphosis. Freshly hatched young appear as tiny termites that grow without significant morphological changes (other than wings and soldier specializations). Some species of termite have dimorphic soldiers (up to three times the size of smaller soldiers). Though their value is unknown, speculation is that they may function as an elite class that defends only the inner tunnels of the mound. Evidence for this is that, even when provoked, these large soldiers do not defend themselves but retreat deeper into the mound. On the other hand, dimorphic soldiers are common in some Australian species of Schedorhinotermes that neither build mounds nor appear to maintain complex nest structures. Some termite taxa are without soldiers; perhaps the best known of these are in the Apicotermitinae.