Behold, We turned towards thee a company of Jinns (quietly) listening to the Qur’an: when they stood in the presence thereof, they said, “Listen in silence!” When the (reading) was finished, they returned to their people, to warn (them of their sins).
The traditions that have been related from Abdullah bin Masud, Zubair, Abdullah bin Abbas, Hasan Basri, Saeed bin Jubair, Zarr bin Hubaish, Mujahid, Ikrimah and others in connection with the commentary of this verse concur that this incident of the first visit of the jinns, which has been mentioned in this verse, had occurred in the valley of Nakhlah. And according to Ibn Ishaq, Abu Nuaim Isfahaini and Waqidi, this incident occurred during the Prophet’s (peace be upon him) return journey from Taif to Makkah. On the way, when he halted at Nakhlah, and was reciting the Quran in the Isha or the Fajr or the Tahajjud Prayer, a group of the jinns happened to pass by and stopped to listen to him. In this connection, all the traditions agree that on this occasion the jinns did not appear before the Prophet (peace be upon him), nor did he feel their presence, but Allah informed him afterwards by revelation that they had come and listened to the Quranic recitation. @ @ The place where this incident took place was either Az- Zaimah or AsSayl-ul-Kabir, for both these places are situated in the valley of Nakhlah and at both water is available and are green; if the travelers from Taif have to halt in this valley, they can halt at either of the places.
Maududi, Abul Ala (2010). Tafhim ul Quran. https://www.englishtafsir.com/Quran/27/index.html