The issue you brought up about the mite is a bit orthogonal to this point. I can give you that the ant was concerned about the possibility of having a mite, and the point still remains that the ant thought it was on its own head only on basis of a reflected image of itself. (Compare to the alternative behavior: the ant tries to get the mite off the reflected image, never making any attempt to remove it from itself.)
it’s on wikipedia, with the same dead source https://en.wikipedia.org/wiki/Mirror_test?wprov=sfti1
EDIT: Working link to the paper (in some journal of science): https://www.udocz.com/read/are-ants-capable-of-self-recognit...
http://difusion.ulb.ac.be/vufind/Record/ULB-DIPOT:oai:dipot....
From what I understand, the current thinking is that the ratio of brain mass to overall body size is much more predictive of intelligence than brain mass by itself. And there are odd cases too in humans like an individual with a severe case of hydrocephaly, with 95% percent of his cranial cavity filled with fluid pushing his brain matter to the sides of his skull, and this individual exhibited very high intelligence and majored in mathematics. There is a lot not known about the brain and animal intelligence, and I would not be surprised if we continue to find out amazing things about ants. I recommend an older book called "Ants at Work" by Deborah Gordon to get an idea of the complexity of ant behavior.
“It is hard for me [to say] exactly the percentage of reduction of the brain, since we did not use software to measure its volume. But visually, it is more than a 50 to 75 per cent reduction,” says Lionel Feuillet, a neurologist at the Mediterranean University in Marseille, France.
https://www.newscientist.com/article/dn12301-man-with-tiny-b...
Oh and lots of time and a huge amount of luck (not even ants can exist on Venus or Mars), but "luck" is just another word for selection bias, or looking backwards in time.
> Where does the leap from nothing to knowledge of that one task come in?
There is no sudden leap, only a huuuuuuuge number of tiny steps and lots of complexity of interactions.
This is gross anthropomorphism. Ants don't have societies any more than the cells in our body have societies.
An ant colony is an organism. Each individual ant has just enough neurons to do the one task that ant does. The overall organism is quite capable, true, but it's not intelligent. It doesn't learn novel things, it doesn't purposely invent, it doesn't 'know' anything.
Ants may take over the world some day, but they won't know it.