Solomon inherited David. He said: “O people! We have been taught the speech of birds, and have been given of all good things. This is indeed a manifest favor (from God)”.
Before Solomon were marshaled his troops of jinn, humans and birds; and they were all lined in orderly ranks.
At length, when they came to a valley of ants, one ant said: “Go into your dwellings, ants, lest Solomon and his troops inadvertently crush you.”
He smiled joyously at her words, and said: “My Lord! Direct my whole being so that I will always be grateful for Your grace which You have bestowed on me and on my parents, and that I may do righteous deeds which will please You; and include me, by Your grace, among Your righteous servants.” (The Ants; Al-Naml: 27: 16-19)
The great procession of humans, jinn and birds was ready before Solomon, “and they were all lined in orderly ranks,” so that there would be no chance of disorder. They are described as “troops” in the verse to indicate the orderly nature of the procession. Before long, Solomon was to have a telling experience: “At length, when they came to a valley of ants, one ant said: ‘Go into your dwellings, ants, lest Solomon and his troops inadvertently crush you. He smiled joyously at her words, and said: ‘My Lord! Direct my whole being so that I will always be grateful for Your grace which You have bestowed on me and on my parents, and that I may do righteous deeds which will please You; and include me, by Your grace, among Your righteous servants.’” (Verses 18-19)
So the procession moved forward in an orderly manner, until they reached a valley where ants were in plenty. In fact the surah describes the place as a valley of ants. At this point, an ant supervisor made an announcement to the ants moving all over the place. It should be remembered that, like bees, ants live in complex social colonies in which different ants have different functions and duties that are organized according to an elaborate system that we might find too difficult to emulate, despite our superior intelligence. So, the supervisor ant announced in the method of communication used by ants that they should hasten back to their dwellings, so that Solomon and his troops would not crush them unaware.
Solomon understood what she said and was pleased. His pleasure was two fold: He smiled at her words like an adult smiles to a child who tries to evade him, fearing that the adult wants to punish him when he has no such intention. And he was gratified that God has given him this gift that opens for him worlds that are normally closed before mankind. He was also joyful at the fact that ants should have such understanding, with the ability of giving orders and carrying them out.
When Solomon gathered what the ant said, “he smiled joyously at her words.” Yet he soon realized what has just happened. He realized that it was all a great gift God had granted him, lifting the barriers that separate different types of creation. He therefore turned to God in acknowledgement of His favors: “My Lord! Direct my whole being so that I will always be grateful for Your grace which You have bestowed on me and on my parents.” (Verse 19) It is a direct address to his Lord, feeling that He is so close to him. He wants his whole being: Organs, feelings and thoughts; heart, mind and tongue; words, actions and direction; talents, abilities and energy to be brought together to offer thanks for all the favors bestowed on him and his parents. Solomon’s prayer indicates how profound was his appreciation of God’s grace. He felt that God’s blessings overwhelmed his whole being as also his parents’. Hence, he wanted to give due thanks with his whole being: “My Lord! Direct my whole being so that I will always be grateful for Your grace which You have bestowed on me and on my parents.” (Verse 19)
“And that I may do righteous deeds which will please You.” (Verse 19) To do good deeds is also a blessing from God to which He directs those who are genuinely grateful for His gifts. Solomon, a truly grateful servant of God who prays for His help so that he would wholeheartedly express his gratitude, also prays to Him to guide him to do what will earn His pleasure.
“And include me, by Your grace, among Your righteous servants.” (Verse 19) Solomon knows that to be included among God’s righteous servants is an aspect of God’s mercy. When it is bestowed on a servant of God, it guides him to do righteous deeds, and thus he would be included in this best group of God’s servants. We note that Solomon, a prophet at whose disposal God placed large sections of jinn, birds and people, does not take anything for granted. He fears lest his deeds or thanksgiving might not be up to the standard expected of him. This is a case of refined sensitivity that enhances Solomon’s aspiration to gain God’s pleasure and receive His mercy. It is expressed at the moment God’s grace is brought in view, as in this case when the ant’s warning to other ants focuses attention on God’s grace that made Solomon understand her speech.
We see here two miracles, not one. The first is Solomon listening to the ant and understanding her warning to her community, and the second is the ant’s awareness that the approaching people were Solomon and his troops. We know that the first case is part of what God taught Solomon, who is a man and a Prophet. Comparatively speaking, this is more probable than the second miracle that is clear in the ant’s words. An ant may recognize that the approaching procession consists of gigantic creatures who could easily crush ants if they step over them. Prompted by their survival instinct God has given them, ants may flee a danger like that. But for an ant to recognize Solomon and his troops is miraculous indeed.