Had It Been That the Jinn Possess Knowledge of The Unseen, They Would Have Known about Prophet Sulaymaan’s [Alayhis-Salaam] Death
In The Name of Allaah, The Most Merciful, The Bestower of Mercy
Allaah [The Mighty and Majestic] said:
فَلَمَّا قَضَيْنَا عَلَيْهِ الْمَوْتَ مَا دَلَّهُمْ عَلَىٰ مَوْتِهِ إِلَّا دَابَّةُ الْأَرْضِ تَأْكُلُ مِنسَأَتَهُ ۖ
فَلَمَّا خَرَّ تَبَيَّنَتِ الْجِنُّ أَن لَّوْ كَانُوا يَعْلَمُونَ الْغَيْبَ مَا لَبِثُوا فِي الْعَذَابِ الْمُهِينِ
Then when We decreed death for him [Sulaiman (Solomon)], nothing informed them (jinns) of his death except a little worm of the earth, which kept (slowly) gnawing away at his stick, so when he fell down, the jinns saw clearly that if they had known the unseen, they would not have stayed in the humiliating torment. [Saba: Ayah: 14]
Had they [i.e. the devils] known the unseen, they would have known of Sulaymaan’s death which was the thing they desired the most, so that they would be saved from the [state] they were in [i.e. Allaah gave Sulaymaan (alayhis-salaam) complete control over them].
[Source: Tayseer Al-Kareem Ar-Rahmaan Fee Tafseer Kalaam Al-Mannaan]