There is not an animal (that lives) on the earth, nor a being that flies on its wings, but (forms part of) communities like you.Nothing have we omitted from the Book, and they (all) shall be gathered to their Lord in the end. (Qur'an, 6:38)
The Jinns And Animals Under Prophet Solomons (pbuh) Command
Earlier, we mentioned that the birds in Prophet Solomon's (pbuh) army and the community of ants in the Valley of the Ants may have been jinns. We noticed their highly conscious behavior, especially the ant community in the Valley of the Ants, which displayed an awareness unseen in other animals.
We will now touch on similar qualities possessed by other animals in the account of Prophet Solomon (pbuh).
However, it was not long delayed, and then it [the hoopoe] said: "I have comprehended something that you have not, and bring you accurate intelligence from Saba. I found a woman ruling over them who has been given everything. She possesses a mighty throne. I found both her and her people prostrating to the Sun instead of God. Satan has made their actions seem good to them and debarred them from the Way, so they are not guided." Qur'an, 27:22-24)
He [Solomon] said: “We will soon see if you have told the truth or are a liar. Take this letter of mine and deliver it to them, and then withdraw from them a little and see how they respond.” (Qur’an, 27:27-28)
He [Solomon] inspected the birds and asked: "How is it that I do not see the hoopoe? Or is it absent without leave?" (Qur'an, 27:20)
When, toward the close of day, nobly-bred, swift-footed steeds were brought before him, he [Solomon] said: "Truly do I love the love of good because of the remembrance of my Lord"—[repeating these words as the steeds raced away,] until they were hidden by the veil [of dust]. [Solomon said:] "Return them to me!" And he set about stroking their shanks and necks. (Qur'an, 38:31-33)
These verses indicate that, like the hoopoe, these horses can disappear from view behind a veil of dust. This may mean that the horses are jinns and can slip in a moment into the jinn world where people cannot see them.
Or, they may be horses but controlled by jinns. The words "return them to me" explains that these horses were brought by others to Prophet Solomon (pbuh), and that these others may have been jinns.
Then when We decreed that he [Solomon] should die, nothing divulged his death to them except the earthworm that ate his staff, so that when he fell down, it was made clear to the jinn that if they had truly had knowledge of the Unseen, they need not have stayed there, suffering humiliating punishment. (Qur'an, 34:14)
Again, the earthworm (dabbat al-ard) mentioned here may have been a jinn. (God knows the truth.)
We tested Solomon and placed a lifeless body on his throne. Then he returned. (Qur'an, 38:34)