Last evening during preparation for dinner and cleaning up afterward I watched a troop of ants shlepping a crumb along the kitchen windowsill.
It was a chaotic effort. Ants joined up and bailed out, seemingly at random. The crumb went left, then right, up, then down, but ever so slowly drifted towards the thin crack under the screen where the ants entered the house.
No ant had the smarts to organize the effort, nor did they recognize that the crumb would never fit through the crack even if they got it there. But still, I had to admire the purposeful collective behavior of creatures individually smaller than the point of a mechanical pencil.
Ants are jampacked chemical factories. They employ the most complex system of chemical communication of any animal. Their glands are endlessly active, puffing and squirting secretions for every purpose. When tastes and scents fail, there are other modes of communication -- tappings, strokings, graspings, nudgings, and antennations.
Put billions of ants together -- as you might put billions of transistor logic gates together, or billions of neurons -- and in their collective fidgeting and simple responses to tactile and chemical signals, you might get some surprisingly sophisticated activity.