Until they came to a valley of ants, a female ant said, "O ants, enter your homes else you will be crushed by Solomon and his soldiers while they do not notice."
Translation endnotes
[27:18] Solomon's demonstration of miracles makes sense within the context of the Quran, but how can we explain the ants’ recognition of Solomon and his troops and communicating this information with each other? Were ants also showing miracles?! Do all ants have such a secret talent? Did they recognize Solomon from the smell of his feet? 20:114.