Kindly refer below our standard reply to similar queries.
and Allah Ta’ala Knows Best
Mufti Ebrahim Desai
Firstly, it must be understood that Allah Ta’ala in His infinite wisdom has only mentioned in the Qur’aan those things which are of benefit for man. Similarly, Nabi (Sallallaahu Alayhi Wasallam) always drew the Sahaaba’s (Radhiallaahu Anhu) attention towards things that will benefit them both in this world and in the hereafter. It is for the very same reason that the Ulama have laid down a principle, ‘whatever was left ambiguous by Allah Ta’ala should be left in ambiguity.’ i.e. it makes no sense for us to dwelve into things which have been left ambiguous for the simple reason that, besides wasting time, it cannot benefit us in the least bit.
Nevertheless, what we do understand from some commentators is that the angels were informed about the creation of Hadhrat Aadam (Alayhis salaam) and his progeny by the Jinn who lived before Aadam (Alayhis salaam). Some scholars say that the Jinn had existed for about two thousand years before Aadam (Alayhis salaam) and thereafter shed blood because of which Allah Ta’ala sent on them an army of angels that drove them out to the depths of the seas. As far as Iblees is concerned, he in reality was a Jinn but used to stay and live around the angels. From here, we can draw an analogy and say that since he used to live around the angels, when the angels were informed of the creation of Aadam (Alayhis salaam) and his progeny, then Iblees also became aware of this.