An individual ant is not very interesting. Its level of intelligence is minimal; its problem solving skills miniscule. But even these limitations allow for rule based behavior. Paired with asynchronous forms of communication such as pheromones in scent markers or trails, or the ability to categorize and count other ants, complex behaviors emerge. Those behaviors either contribute to the survival of the colony or they don’t, so environmental pressures help select for what works.