Book Name:Hazrat Dawood aur Hazrat Suleman
they passed by that valley in Taif or Shaam where there were many ants, after seeing the army of Sayyiduna Sulayman عَـلَيْـهِ الـسَّـلَام, the queen ant said:
یّٰۤاَیُّهَا النَّمْلُ ادْخُلُوْا مَسٰكِنَكُمْۚ-لَا یَحْطِمَنَّكُمْ سُلَیْمٰنُ وَ جُنُوْدُهٗۙ-وَ هُمْ لَا یَشْعُرُوْنَ(۱۸)
'O ants, enter your homes; Sulayman and his armies may not crush you, unknowingly.'
[Kanz-ul-Iman (translation of Quran)] (Part 19, Surah Al-Naml, verse 18)
The queen said this because she knew Sayyiduna Sulayman عَـلَيْـهِ الـسَّـلَام is a Prophet, he is just and does not commit oppression. Hence, if his army did crush any ants, they would only do so unknowingly, for it is possible that they would not pay attention to them whilst walking. Sayyiduna Sulayman عَـلَيْـهِ الـسَّـلَام heard the ant saying this from a distance of 3 miles, thus, he عَـلَيْـهِ الـسَّـلَام was amazed and began to smile after hearing about her protection of the other ants, her planning for their requirements and her advice to the ants, and he said in the Court of Allah Almighty:
رَبِّ اَوْزِعْنِیْۤ اَنْ اَشْكُرَ نِعْمَتَكَ الَّتِیْۤ اَنْعَمْتَ عَلَیَّ وَ عَلٰى وَالِدَیَّ وَ اَنْ اَعْمَلَ صَالِحًا تَرْضٰىهُ وَ اَدْخِلْنِیْ بِرَحْمَتِكَ فِیْ عِبَادِكَ الصّٰلِحِیْنَ(۱۹)
'O my Lord, enable me that I thank You for the favour which You have bestowed upon me and my parents; and so that I may perform such a good deed which pleases You; and by Your Mercy, include me amongst Your bondsmen who are worthy of Your special proximity.'
[Kanz-ul-Iman (translation of Quran)] (Part 19, Surah Al-Naml, verse 19)
So when he reached close to the valley of ants, he commanded his armies to stop, to the extent that the ants entered their homes. (Jalalayn,