The jinn are a category of created being in Islamic belief, not a folklore curiosity. The Quran states that God created them from a smokeless fire as he created humans from clay (55:15), gives them a sura of their own (72, al-Jinn), and describes some of them hearing the recitation and accepting the message. They are, like humans, morally responsible and destined for judgement: there are believing and unbelieving jinn, and Iblis (Satan), who refused to bow to Adam, is said in the Quran to have been "of the jinn." They occupy a world parallel to the human one, ordinarily unseen, and can take various forms. Pre-Islamic Arabian religion already knew the jinn as spirits of the wild places, and Islam did not abolish the belief but reframed it within monotheism, the jinn are creatures under God, not powers to be worshipped.
Sura 34:12-13 and 21:82 describe jinn compelled into Solomon's service, building and diving for him by divine command, a specifically Quranic and pre-Quranic Near Eastern tradition of Solomon's mastery over spirits that later Islamic legend, and the Testament of Solomon in the adjacent Jewish and Christian tradition, expanded considerably further. It is this expanded, legendary Solomon material, transmitted through story-cycles such as the Thousand and One Nights, that eventually produced the wish-granting genie of popular storytelling, a bottled or lamp-bound servant compelled by magic, a figure that has drifted very far from the Quran's own jinn, who are free moral agents under divine judgement rather than magical servants bound to any human master.