Sure Al-An'aam

6:129

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

So machen Wir die einen Ungerechten zu Beschützern der anderen für das, was sie erworben haben.

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.