(In the Name of Allah, the Most Gracious, the Most Merciful.
The Jinns listening to the Qur'an and Their Belief in It
Allah commands His Messenger to inform his people that the Jinns listened to the Qur'an, believed in it, affirmed its truthfulness and adhered to it. So Allah says,
(Say: "It has been revealed to me that a group of Jinn listened. They said: `Verily, we have heard a wonderful Recitation! It guides to the right path"') meaning, to what is correct and success.
(...and that some people from human beings used to seek refuge with some peoples of the Jinn, and thus they increased them (the Jinns) in arrogance, [ 72:6] '
This verse describes the situation that it was customary for people in the Days of Ignorance that when they halted in a valley in the course of a journey, they sought refuge in the Jinn leader of that valley from the foolish mischief-makers of his nation believing that the leader of the valley will protect them. This made the Jinn think that they are better than human beings. That is why, they seek refuge in their leader but this increased the wickedness of the Jinn.
In this world, in addition to human beings and angels, there is another set of creatures known as jinn. Human beings cannot see them but, in the Quran, they have been mentioned at several places. These verses show that among the jinn also there are guided and misguided types. Just as there are foolish leaders who misguide the common people, similarly there are foolish leaders among the jinn, who go on misguiding them with deceitful utterances. So far as the angels are concerned, they are not being put to the test, and thus do not have free will. They simply follow the commands given by God.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.