Discussion about what the previous Peoples did, and what was done to Them
Allah says,
قَدْ مَكَرَ الَّذِينَ مِن قَبْلِهِمْ
Those before them indeed plotted,
Al-Awfi reported that Ibn Abbas said;
"This refers to Namrud (Nimrod), who built the tower."
Others said that it refers to Bukhtanassar (Nebuchadnezzar).
The correct view is that this is said by way of example, to refute what was done by those who disbelieved in Allah and associated others in worship with Him.
As Nuh said,
وَمَكَرُواْ مَكْراً كُبَّاراً
"And they have hatched a mighty scheme." (71;22)
meaning, they used all sorts of ploys to misguide their people, and tempted them to join them in their Shirk via all possible means.
On the Day of Resurrection their followers will say to them;
بَلْ مَكْرُ الَّيْلِ وَالنَّهَارِ إِذْ تَأْمُرُونَنَأ أَن نَّكْفُرَ بِاللَّهِ وَنَجْعَلَ لَهُ أَندَاداً
"Nay, but it was your plotting by night and day, when you ordered us to disbelieve in Allah and set up rivals to Him!" (34;33)
فَأَتَى اللّهُ بُنْيَانَهُم مِّنَ الْقَوَاعِدِ
but Allah struck at the foundation of their building.
meaning, He uprooted it and brought their efforts to naught.
This is like the Ayah;
كُلَّمَأ أَوْقَدُواْ نَاراً لِّلْحَرْبِ أَطْفَأَهَا اللَّهُ
Every time they kindled the fire of war, Allah extinguished it. (5;64)
and,
فَأَتَـهُمُ اللَّهُ مِنْ حَيْثُ لَمْ يَحْتَسِبُواْ وَقَذَفَ فِى قُلُوبِهِمُ الرُّعْبَ يُخْرِبُونَ بُيُوتَهُمْ بِأَيْدِيهِمْ وَأَيْدِى الْمُوْمِنِينَ فَاعْتَبِرُواْ يأُوْلِى الاٌّبْصَـرِ
But Allah's (torment) reached them from a place where they were not expecting it, and He cast terror into their hearts so that they destroyed their own dwellings with their own hands and the hands of the believers. So then take admonition, O you with eyes (to see). (59;2)
Allah says here;
فَأَتَى اللّهُ بُنْيَانَهُم مِّنَ الْقَوَاعِدِ
فَخَرَّ عَلَيْهِمُ السَّقْفُ مِن فَوْقِهِمْ وَأَتَاهُمُ الْعَذَابُ مِنْ حَيْثُ لَا يَشْعُرُونَ