Tafsir Ibn Kathir -> Surah Al-Kahf -> The Story of Dhul-Qarnayn Allah says to His Prophet ,

﴿وَيَسْـَلُونَكَ﴾

(And they ask you) O Muhammad ,

﴿عَن ذِى الْقَرْنَيْنِ﴾

(about Dhul-Qarnayn.) i.e., about his story. We have already mentioned how the disbelievers of Makkah sent word to the People of the Book and asked them for some information with which they could test the Prophet . They (the People of the Book) said, `Ask him about a man who traveled extensively throughout the earth, and about some young men who nobody knows what they did, and about the Ruh (the soul),' then Surat Al-Kahf was revealed. Dhul-Qarnayn had great Power

﴿إِنَّا مَكَّنَّا لَهُ فِى الاٌّرْضِ﴾

(Verily, We established him in the earth,) means, `We have given him great power, so that he had all that kings could have of might, armies, war equipment and siege machinery.' So he had dominion over the east and the west, all countries and their kings submitted to him, and all the nations, Arab and non-Arab, served him. Some of them said he was called Dhul-Qarnayn (the one with two horns) because he reached the two "Horns" of the sun, east and west, where it rises and where it sets.

﴿وَآتَيْنَـهُ مِن كُلِّ شَىْءٍ سَبَباً﴾

(and We gave him the means of everything.) Ibn `Abbas, Mujahid, Sa`id bin Jubayr, `Ikrimah, As-Suddi, Qatadah, Ad-Dahhak and others said, "This means knowledge.'' Qatadah also said,

﴿وَآتَيْنَـهُ مِن كُلِّ شَىْءٍ سَبَباً﴾

(and We gave him the means of everything.) "The different parts and features of the earth.'' Concerning Bilqis, Allah said,

﴿وَأُوتِيَتْ مِن كُلِّ شَىْءٍ﴾

(she has been given all things) ﴿27:23﴾, meaning all things that monarchs like her are given. Thus too was Dhul-Qarnayn: Allah gave him the means of all things, meaning the means and power to conquer all areas, regions and countries, to defeat enemies, suppress the kings of the earth and humiliate the people of Shirk. He was given all that a man like him would need. And Allah knows best.

﴿فَأَتْبَعَ سَبَباً - حَتَّى إِذَا بَلَغَ مَغْرِبَ الشَّمْسِ وَجَدَهَا تَغْرُبُ فِى عَيْنٍ حَمِئَةٍ وَوَجَدَ عِندَهَا قَوْماً قُلْنَا يذَا الْقَرْنَيْنِ إِمَّآ أَن تُعَذِّبَ وَإِمَّآ أَن تَتَّخِذَ فِيهِمْ حُسْناً - قَالَ أَمَّا مَن ظَلَمَ فَسَوْفَ نُعَذِّبُهُ ثُمَّ يُرَدُّ إِلَى رَبِّهِ فَيُعَذِّبُهُ عَذَاباً نُّكْراً - وَأَمَّا مَنْ آمَنَ وَعَمِلَ صَـلِحاً فَلَهُ جَزَآءً الْحُسْنَى وَسَنَقُولُ لَهُ مِنْ أَمْرِنَا يُسْراً ﴾

(85. So he followed a way.) (86. Until, when he reached the setting place of the sun, he found it setting in a spring of Hami'ah. And he found near it a people. We said: "O Dhul-Qarnayn! Either you punish them or treat them with kindness.'') (87. He said: "As for him who does wrong, we shall punish him, and then he will be brought back unto his Lord, Who will punish him with a terrible torment (Hell).'') (88. "But as for him who believes and works righteousness, he shall have the best reward, and we shall speak unto him mild words.'')