According to Deborah M. Gordon
Contrary to another of our beloved myths about ants, told by Aesop, Homer, and the writer of Proverbs 6:6, many ants don’t work very hard. In a large harvester-ant colony, about a third of the ants at any time are hanging around doing nothing. As Mark Twain put it, this “will be a disappointment for the Sunday schools.” Because colony behavior is regulated by a network of interactions, inactivity might have its uses. Idle ants may act as a buffer to dampen the interaction rate when it gets too high. My colleagues and I have found that ants will move around to adjust their interaction rate—either they seek each other out when there are few ants, or they avoid each other when crowded. Sometimes interactions create positive feedback, as when ants go out to forage in response to interactions with foragers bringing food back to the nest. But eventually this could lead ants to search for food when there is none left. The colony may need some inert ants, unlikely to be stimulated by interactions, to buffer the network.
According to J.M. Ledgard
A defining factor of ants is the speed at which they communicate through chemical cues. These pheromonal messages are simple—“Look, this is my caste, this my condition,” or, “Raise more soldiers”—but in the context of the super-organism they create a common intelligence capable of dealing with complicated problems.
Aside: Ants and cockroaches keep you honest. They are relentless, unappeasable, compulsive-obsessive little health inspectors on the job 24/7. See also “Robots, you’re hired“.