Allah Almighty created Adam pbuh and He favored him above many of His creations. He gave him vast knowledge and taught him the names of all things then He told the angels to tell Him those names. The angels did not know them. He told Adam PBUH to tell them the names and he did.
(He taught Adam the names of all things, then He presented them to the angels and said, “Tell Me the names of these, if what you say is true?” They replied, “Glory be to You! We have no knowledge except what You have taught us. You are truly the All-Knowing, All-Wise.” Allah said, “O Adam! Inform them of their names.” Then when Adam did, Allah said, “Did I not tell you that I know the secrets of the heavens and the earth, and I know what you reveal and what you conceal?”) Al-Baqara 2:31-33
لقد خلق الله تعالى آدم عليه السلام و فضله على كثير من المخلوقات و أعطاه علما واسعا و علمه أسماء كل الأشياء ثم قال للملائكة أن يخبروه بهذه الأسماء فلم يعرفوها, قال لآدم أن يخبرهم بهذه الأسماء ففعل.
وَعَلَّمَ ءَادَمَ ٱلأَسْمَآءَ كُلَّهَا ثُمَّ عَرَضَهُمْ علَى ٱلْمَلَٰئِكَةِ فَقَالَ أَنْبِئُونِي بِأَسْمَآءِ هَـٰؤُلاۤءِ إِن كُنْتُمْ صَٰدِقِين قَالُواْ سُبْحَٰنَكَ لاَ عِلْمَ لَنَآ إِلاَّ مَا عَلَّمْتَنَآ إِنَّكَ أَنْتَ ٱلْعَلِيمُ ٱلْحَكِيمُ قَالَ يَآءَادَمُ أَنبِئْهُمْ بِأَسْمَآئِهِمْ فَلَمَّآ أَنْبَأَهُمْ بِأَسْمَآئِهِمْ قَالَ أَلَمْ أَقُلْ لَّكُمْ إِنِيۤ أَعْلَمُ غَيْبَ ٱلسَّمَٰوَٰتِ وَٱلأَرْضِ وَأَعْلَمُ مَا تُبْدُونَ وَمَا كُنْتُمْ تَكْتُمُون )
َالبقرة 2: 31 – 33