إِلاَّ الَّذِينَ كَفَرُواْ
(but those who disbelieve), i.e., those who reject the signs of Allah and His proof and evidence.
فَلاَ يَغْرُرْكَ تَقَلُّبُهُمْ فِى الْبِلاَدِ
(So let not their ability of going about here and there through the land deceive you!) means, their wealth and luxurious life. This is like the Ayah:
لاَ يَغُرَّنَّكَ تَقَلُّبُ الَّذِينَ كَفَرُواْ فِى الْبِلَـدِ - مَتَـعٌ قَلِيلٌ ثُمَّ مَأْوَاهُمْ جَهَنَّمُ وَبِئْسَ الْمِهَادُ
(Let not the free disposal (and affluence) of the disbelievers throughout the land deceive you. A brief enjoyment; then, their ultimate abode is Hell; and worst indeed is that place for rest.) (3:196-197)
نُمَتِّعُهُمْ قَلِيلاً ثُمَّ نَضْطَرُّهُمْ إِلَى عَذَابٍ غَلِيظٍ
(We let them enjoy for a little while, then in the end We shall oblige them to (enter) a great torment.) (31:24). Then Allah consoles His Prophet Muhammad ﷺ for the rejection of his people. He tells him that he has an example in the Prophets who came before him, may the blessings and peace of Allah be upon them all, for their nations disbelieved them and opposed them, and only a few believed in them.
كَذَّبَتْ قَبْلَهُمْ قَوْمُ نُوحٍ
(The people of Nuh denied before these;) Nuh was the first Messenger whom Allah sent to denounce and forbid idol worship.
وَالاٌّحْزَابُ مِن بَعْدِهِمْ
(and the groups after them) means, from every nation.
وَهَمَّتْ كُـلُّ أُمَّةٍ بِرَسُولِهِمْ لِيَأْخُذُوهُ
(and every (disbelieving) nation plotted against their Messenger to seize him,) means, they wanted to kill him by any means possible, and some of them did kill their Messenger.
وَجَـدَلُوا بِالْبَـطِلِ لِيُدْحِضُواْ بِهِ الْحَقَّ
(and disputed by means of falsehood to refute therewith the truth.) means, they came up with specious arguments with which to dispute the truth which was so plain and clear.
(So I seized them) means, `I destroyed them, because of the sins they committed.'
فَكَيْفَ كَانَ عِقَابِ
(and how was My punishment!) means, `how have you heard that My punishment and vengeance was so severe and painful.' Qatadah said, "It was terrible, by Allah."
وَكَذَلِكَ حَقَّتْ كَلِمَةُ رَبِّكَ عَلَى الَّذِينَ كَفَرُواْ أَنَّهُمْ أَصْحَـبُ النَّارِ
(Thus has the Word of your Lord been justified against those who disbelieved, that they will be the dwellers of the Fire.) means, `just as the Word of punishment was justified against those of the past nations who disbelieved, so too is it justified against these disbelievers who have rejected you and gone against you, O Muhammad, and it is even more justified against them, because if they have disbelieved in you, there is no certainty that they will believe in any other Prophet.' And Allah knows best.