Sura Al-An'aam

6:129

وَكَذَٰلِكَ نُوَلِّى بَعْضَ ٱلظَّٰلِمِينَ بَعْضًۢا بِمَا كَانُوا۟ يَكْسِبُونَ

Så ger Vi några av de orättfärdiga makt över de andra, på grund av de [onda] handlingar som de begår.

Tafsir 6:129

Just as I gave some of the rebellious jinn the ability to mislead some people, I will give an authority and power to every evil sinner so that they may influence other sinners-prompting them to do evil and create a dislike in their hearts and turn them away from good. This is a just recompense for the sins they used to commit.