Scientists in Australia have discovered that ants have an incredible memory for smell, which means they can sniff out their enemies.
When one ant fights with an intruder from another group of ants, or 'colony', it keeps that enemy's smell: passing it on to the rest of the colony.
All it takes is for one ant to get the smell of its enemy, and the rest of the army of up to 500,000 ants can smell the invaders.
The team of experts, from the University of Melbourne in Australia, tried to discover if ants were able to keep memories of the smells they encounter.
Lead researcher Prof Mark Elgar explained the findings.
He said to imagine you had a bad experience with a particular group of people, a bit like rival football fans.
"Perhaps they all wear the same coloured scarf of their football team", he suggested. "And you warned your colleagues to look out for people wearing that coloured scarf."
Then one of you might tell your friends to watch out for the others, and they pass on the news. Everyone gradually gets the information.
Professor Elgar said that ants do exactly the same, but instead of telling each other with speech, they pass on the smell to each other.