I heard my father say, I asked Masruq, "Who informed the Prophet ﷺ of the jinn on the night they listened to the Quran?"He replied, "Your father, meaning Abdullah, told me that a tree informed him of them."
سمعت أبي قال: سألت مسروقا من آذن النبي ﷺ بالجن ليلة استمعوا القرآن؟ فقال: حدثني أبوك-يعني عبد الله- أنه آذنت بهم شجرة.
Bukhari narrated it in the Virtues of the Ansar (3859), and Muslim in the Prayer (450:153), both from Ubaydullah bin Saeed, who said, our teacher Abu Usama narrated to us, our teacher Masaar narrated to us, from Maen bin Abdul-Rahman, who said, then he mentioned it.His statement, "Who informed the Prophet ﷺ," means, who made him aware of the presence of the jinn. And his statement, "A tree informed him of them," means that the tree which was beside him, and this is one of the miracles of the Prophet ﷺ, as is established in the sahih, where he said, "I indeed know a stone in Makkah that used to greet me." For Allah placed speech within inanimate objects, as He says, "And there is not a thing except that it glorifies Him with praise, but you do not understand their glorification" [Isra 17:44]. Miracles of this kind are numerous, as mentioned in the book on the biography of the Prophet ﷺ. The discussion about the jinn and their listening to the Quran is treated at length in the book on the Beginning of Creation.