Sanaan al-Gamali is a wealthy merchant who has been told by a genie that he must kill Ali al-Salouli, the corrupt governor of the quarter, or be killed himself. Out of a combination of self-preservation and sheer terror, al-Gamali agrees, but in doing so he reveals a dark side of his character that leads him to commit ever more immoral acts.
Before long, al-Gamali's personality has undergone such a dramatic change that he feels a desire to destroy everyone and everything. His growing sense of rage leads him to commit increasingly iniquitous acts. First, he starts taking a large amount of drugs. Then, he begins imagining dead female relatives in sexually suggestive poses. If all this weren't bad enough, al-Gamali descends into absolute iniquity by sexually abusing and killing a ten-year-old girl. Al-Gamali's soul has been totally corrupted by evil.
The significance of al-Gamali's moral decline is that it raises the age-old question of our responsibility for our actions. As he reflects on his iniquitous actions, al-Gamali wonders whether the genie is ultimately responsible for the truly appalling things that he's done or whether he himself, al-Gamali, is to blame. For his part, the genie is in no doubt that al-Gamali is responsible. As he tells al-Gamali:
Instead of attaining the visible target, your whole structure collapsed and you committed this repugnant crime.
Another way of looking at the situation is to say that genies are only externalizations of the human impulses toward good and evil. That being the case, evil is not supernatural; it doesn't come from genies. Man is therefore entirely responsible for his actions, and the wicked Sanaan al-Gamali is no exception.