Allah created the angels and they don’t have free will, they just do everything Allah wills. Just because humans have free will doesn’t nullify what Allah wills for us. Allah usually doesn’t command your actions such as it does with the angels, you are not an angel. Allah drives you astray or not depending on your actions. And has the power to allow or deny any action humans does.
When one goes to school to have exams you are doing exactly what your teacher wants you to do. You do the exam to pass it. If you take it serious or not is your choice; You cannot change or defraud the test. The teacher can also predict which students will potentially pass or not, they will not write the answers for you nor decide for you, despite potentially knowing which students will do better, they also usually prefer some students in relation to others.
Those were the ones upon whom Allah bestowed favor from among the
prophets of the descendants of Adam and of those We carried [in the
ship] with Noah, and of the descendants of Abraham and Israel, and of
those whom We guided and chose. When the verses of the Most Merciful
were recited to them, they fell in prostration and weeping. 19|58
Being a good student or not, in that moment the objective is common, to pass it. You don’t have free will for doing whatever you want to do, the main reason is to not having escuses for not having done what you should have done - That’s in the Al-Quran and Hadiths, transmited by Allah and its mensengers; You must be a muslim (which means one is submited to God).
It is not for a believing man or a believing woman, when Allah and His
Messenger have decided a matter, that they should [thereafter] have
any choice about their affair. And whoever disobeys Allah and His
Messenger has certainly strayed into clear error. 33|36
The Creator will judge you based on your actions and you will know if you passed the test or not (in the judgement day). - and you’ll get your reward, that’s what I consider us and jinn a better creation than the angels, we have free will - you are doing a test that your creator wants you to do, and determined, and is everything as He planned.
And we had thought that mankind and the jinn would never speak about
Allah a lie. 72|5
And it is not [possible] for one to die except by permission of Allah
at a decree determined. And whoever desires the reward of this world -
We will give him thereof; and whoever desires the reward of the
Hereafter - We will give him thereof. And we will reward the grateful. 3|145
I will not end explaining what is free will, because it's outside of the scope. But take this final verse:
And it is He who accepts repentance from his servants and pardons
misdeeds, and He knows what you do. 42|25
Allah clearly doesn't repent for you, according to Islam, it was given Jinns and humans free will to do so. That potentially explains the nature behind Allah's will regarding us and the Jinn, the main reason is to submit ourselfs to Him using our free will and the same applies to the Jinns, in which Allah gave them the power to potentially influence our decisions.
And thus We have made for every prophet an enemy - devils from mankind
and jinn, inspiring to one another decorative speech in delusion. But
if your Lord had willed, they would not have done it, so leave them
and that which they invent. 6|112