Genie. Jinn. Shaytun. Demon. Whatever you call them, they're all the same beast.
Jinn are mentioned as "shaytun" in the book of Enoch and ever since then - and whilst they are not inherently good nor bad - they have been popularly depicted as a manifestation of evil. So how do we explain the whole "genie in a bottle" thing, the stereotype of them being a good and benevolent thing, bestowing luck upon whomever is fortunate to find, and then rub, the genie's abode and stoke its powers into action?
Read on because history always has a plethora of plausible explanations for stuff like this.