...
وَلَا تُفۡسِدُوۡا فِى الۡاَرۡضِ بَعۡدَ اِصۡلَاحِهَا وَادۡعُوۡهُ خَوۡفًا وَّطَمَعًا ؕ اِنَّ رَحۡمَتَ اللّٰهِ قَرِيۡبٌ مِّنَ الۡمُحۡسِنِيۡنَ ٥٦
Do not spread corruption in the land after it has been set in order. And call upon Him with hope and fear. Indeed, Allah’s mercy is always close to the good-doers.
[Al-Quran 7:56, Translation: Dr. Mustafa Khattab, The Clear Quran]
-----
ثُمَّ أَتْبَعَ سَبَبًا ٩٢
Then he followed a road
حَتَّىٰٓ إِذَا بَلَغَ بَيْنَ ٱلسَّدَّيْنِ وَجَدَ مِن دُونِهِمَا قَوْمًۭا لَّا يَكَادُونَ يَفْقَهُونَ قَوْلًۭا ٩٣
Till, when he came between the two mountains, he found upon their hither side a folk that scarce could understand a saying.
قَالُوا۟ يَـٰذَا ٱلْقَرْنَيْنِ إِنَّ يَأْجُوجَ وَمَأْجُوجَ مُفْسِدُونَ فِى ٱلْأَرْضِ فَهَلْ نَجْعَلُ لَكَ خَرْجًا عَلَىٰٓ أَن تَجْعَلَ بَيْنَنَا وَبَيْنَهُمْ سَدًّۭا ٩٤
They said: O Dhu'l-Qarneyn! Lo! Gog and Magog are spoiling the land. So may we pay thee tribute on condition that thou set a barrier between us and them?
قَالَ مَا مَكَّنِّى فِيهِ رَبِّى خَيْرٌۭ فَأَعِينُونِى بِقُوَّةٍ أَجْعَلْ بَيْنَكُمْ وَبَيْنَهُمْ رَدْمًا ٩٥
He said: That wherein my Lord hath established me is better (than your tribute). Do but help me with strength (of men), I will set between you and them a bank.
ءَاتُونِى زُبَرَ ٱلْحَدِيدِ ۖ حَتَّىٰٓ إِذَا سَاوَىٰ بَيْنَ ٱلصَّدَفَيْنِ قَالَ ٱنفُخُوا۟ ۖ حَتَّىٰٓ إِذَا جَعَلَهُۥ نَارًۭا قَالَ ءَاتُونِىٓ أُفْرِغْ عَلَيْهِ قِطْرًۭا ٩٦
Give me pieces of iron - till, when he had levelled up (the gap) between the cliffs, he said: Blow! - till, when he had made it a fire, he said: Bring me molten copper to pour thereon.
فَمَا ٱسْطَـٰعُوٓا۟ أَن يَظْهَرُوهُ وَمَا ٱسْتَطَـٰعُوا۟ لَهُۥ نَقْبًۭا ٩٧
And (Gog and Magog) were not able to surmount, nor could they pierce (it).
قَالَ هَـٰذَا رَحْمَةٌۭ مِّن رَّبِّى ۖ فَإِذَا جَآءَ وَعْدُ رَبِّى جَعَلَهُۥ دَكَّآءَ ۖ وَكَانَ وَعْدُ رَبِّى حَقًّۭا ٩٨
He said: This is a mercy from my Lord; but when the promise of my Lord cometh to pass, He will lay it low, for the promise of my Lord is true.
۞ وَتَرَكْنَا بَعْضَهُمْ يَوْمَئِذٍۢ يَمُوجُ فِى بَعْضٍۢ ۖ وَنُفِخَ فِى ٱلصُّورِ فَجَمَعْنَـٰهُمْ جَمْعًۭا ٩٩
And on that day we shall let some of them surge against others, and the Trumpet will be blown. Then We shall gather them together in one gathering.
[Al-Quran 18:92-99, Translation: M. Pickthall]
-----
وَحَرَٰمٌ عَلَىٰ قَرْيَةٍ أَهْلَكْنَـٰهَآ أَنَّهُمْ لَا يَرْجِعُونَ ٩٥
And it is prohibited to [the people of] a city which We have destroyed that they will [ever] return
حَتَّىٰٓ إِذَا فُتِحَتْ يَأْجُوجُ وَمَأْجُوجُ وَهُم مِّن كُلِّ حَدَبٍۢ يَنسِلُونَ ٩٦
Until when [the dam of] Gog and Magog has been opened and they, from every elevation, descend
[Al-Quran 21:95-96, Translation: Saheeh International]
' Go back, and we will dig it tomorrow if Allah wills.' So they will say: "If Allah wills." '
وَمِنَ ٱلنَّاسِ مَن يُعْجِبُكَ قَوْلُهُۥ فِى ٱلْحَيَوٰةِ ٱلدُّنْيَا وَيُشْهِدُ ٱللَّهَ عَلَىٰ مَا فِى قَلْبِهِۦ وَهُوَ أَلَدُّ ٱلْخِصَامِ ٢٠٤
There is the type of man whose speech about this world's life May dazzle thee, and he calls Allah to witness about what is in his heart; yet is he the most contentious of enemies.
وَإِذَا تَوَلَّىٰ سَعَىٰ فِى ٱلْأَرْضِ لِيُفْسِدَ فِيهَا وَيُهْلِكَ ٱلْحَرْثَ وَٱلنَّسْلَ ۗ وَٱللَّهُ لَا يُحِبُّ ٱلْفَسَادَ ٢٠٥
When he turns his back, His aim everywhere is to spread mischief through the earth and destroy crops and cattle progeny. But Allah loveth not mischief.
وَإِذَا قِيلَ لَهُ ٱتَّقِ ٱللَّهَ أَخَذَتْهُ ٱلْعِزَّةُ بِٱلْإِثْمِ ۚ فَحَسْبُهُۥ جَهَنَّمُ ۚ وَلَبِئْسَ ٱلْمِهَادُ ٢٠٦
When it is said to him, "Fear Allah", He is led by arrogance to (more) crime. Enough for him is Hell;-An evil bed indeed (To lie on)!
[Al-Quran 2:204-206, Translation: A. Yusuf Ali, edited in italics]
So, these criminals are so-called believers, whose speech is pleasing to the ears, but their actions are those which cause corruption.
The wisdom behind releasing Gog and Magog (يَأْجُوجُ وَمَأْجُوجُ) may be to generate the evidence that whenever the criminals are given a chance, they revert to their criminal behaviour, corrupting the Earth. The Earth was amended before (Q7:56), the Gog Magog were contained behind a metallic barrier (Q18:92-99). When they break that barrier, they will again corrupt the Earth (Q21:95-96). The land will be corrupted.
For the criminals, the doors in the sky will not be opened, and they will not be able to pass through it, at least until the camel cannot pass through the eye of the needle. What does that mean? A very distant future? The devolution of species? Until the skies and earth last? ...
Allah سُبْحَانَهُ وَتَعَالَى gives everyone a chance to repent and reform. Yet, in His Knowledge and Wisdom, He knows that the criminals will not choose to repent and reform. Every time they are given some power and authority, they cause corruption. Gog and Magog are the most extreme example. When they are released, they will make the Earth hellish. When all matters are brought to an end, the Believers will be able to ascend through the gates in the sky to Gardens of Perfection, which they will inherit, to maintain and enjoy it, always and forever.
The criminals will remain in the Hell on Earth.
...
Hadith
حَدَّثَنَا أَزْهَرُ بْنُ مَرْوَانَ، حَدَّثَنَا عَبْدُ الأَعْلَى، حَدَّثَنَا سَعِيدٌ، عَنْ قَتَادَةَ، قَالَ حَدَّثَنَا أَبُو رَافِعٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " إِنَّ يَأْجُوجَ وَمَأْجُوجَ يَحْفِرُونَ كُلَّ يَوْمٍ حَتَّى إِذَا كَادُوا يَرَوْنَ شُعَاعَ الشَّمْسِ قَالَ الَّذِي عَلَيْهِمُ ارْجِعُوا فَسَنَحْفِرُهُ غَدًا . فَيُعِيدُهُ اللَّهُ أَشَدَّ مَا كَانَ حَتَّى إِذَا بَلَغَتْ مُدَّتُهُمْ وَأَرَادَ اللَّهُ أَنْ يَبْعَثَهُمْ عَلَى النَّاسِ حَفَرُوا حَتَّى إِذَا كَادُوا يَرَوْنَ شُعَاعَ الشَّمْسِ قَالَ الَّذِي عَلَيْهِمُ ارْجِعُوا فَسَتَحْفِرُونَهُ غَدًا إِنْ شَاءَ اللَّهُ تَعَالَى وَاسْتَثْنَوْا فَيَعُودُونَ إِلَيْهِ وَهُوَ كَهَيْئَتِهِ حِينَ تَرَكُوهُ فَيَحْفِرُونَهُ وَيَخْرُجُونَ عَلَى النَّاسِ فَيَنْشِفُونَ الْمَاءَ وَيَتَحَصَّنُ النَّاسُ مِنْهُمْ فِي حُصُونِهِمْ فَيَرْمُونَ بِسِهَامِهِمْ إِلَى السَّمَاءِ فَتَرْجِعُ عَلَيْهَا الدَّمُ الَّذِي اجْفَظَّ فَيَقُولُونَ قَهَرْنَا أَهْلَ الأَرْضِ وَعَلَوْنَا أَهْلَ السَّمَاءِ فَيَبْعَثُ اللَّهُ نَغَفًا فِي أَقْفَائِهِمْ فَيَقْتُلُهُمْ بِهَا " . قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " وَالَّذِي نَفْسِي بِيَدِهِ إِنَّ دَوَابَّ الأَرْضِ لَتَسْمَنُ وَتَشْكَرُ شَكَرًا مِنْ لُحُومِهِمْ " .
It was narrated from Abu Hurairah that the Messenger of Allah (ﷺ) said: "Gog and Magog people dig every day until, when they can almost see the rays of the sun, the one in charge of them says: "Go back and we will dig it tomorrow." Then Allah puts it back, stronger than it was before. (This will continue) until, when their time has come, and Allah wants to send them against the people, they will dig until they can almost see the rays of the sun, then the one who is in charge of them will say: "Go back, and we will dig it tomorrow if Allah wills.' So they will say: "If Allah wills." Then they will come back to it and it will be as they left it. So they will dig and will come out to the people, and they will drink all the water. The people will fortify themselves against them in their fortresses. They will shoot their arrows towards the sky and they will come back with blood on them, and they will say: "We have defeated the people of earth and dominated the people of heaven." Then Allah will send a worm in the napes of their necks and will kill them thereby.'" The Messenger of Allah (ﷺ) said: "By the One in Whose Hand is my soul, the beasts of the earth will grow fat on their flesh."
Sunan Ibn Majah 4080