The Jews breach the Sanctity of the Sabbath

Allah said,

وَلَقَدْ عَلِمْتُمُ

(And indeed you knew). This Ayah means, O Jews! Remember that Allah sent His torment on the village that disobeyed Him and broke their pledge and their covenant to observe the sanctity of the Sabbath. They began using deceitful means to avoid honoring the Sabbath by placing nets, ropes and artificial pools of water for the purpose of fishing before the Sabbath. When the fish came in abundance on Saturday as usual, they were caught in the ropes and nets for the rest of Saturday. During the night, the Jews collected the fish after the Sabbath ended. When they did that, Allah changed them from humans into monkeys, the animals having the form closest to humans. Their evil deeds and deceit appeared lawful on the surface, but they were in reality wicked. This is why their punishment was compatible with their crime. This story is explained in detail in Surat Al-A`raf, where Allah said (7:163),

وَسْئَلْهُمْ عَنِ الْقَرْيَةِ الَّتِى كَانَتْ حَاضِرَةَ الْبَحْرِ إِذْ يَعْدُونَ فِى السَّبْتِ إِذْ تَأْتِيهِمْ حِيتَانُهُمْ يَوْمَ سَبْتِهِمْ شُرَّعًا وَيَوْمَ لاَ يَسْبِتُونَ لاَ تَأْتِيهِمْ كَذَلِكَ نَبْلُوهُم بِمَا كَانُوا يَفْسُقُونَ

(And ask them (O Muhammad ) about the town that was by the sea; when they transgressed in the matter of the Sabbath (i.e. Saturday): when their fish came to them openly on the Sabbath day, and did not come to them on the day they had no Sabbath. Thus We made a trial of them, for they used to rebel (disobey Allah).)(7:163)

In his Tafsir, Al-`Awfi reported from Ibn `Abbas that he said,

فَقُلْنَا لَهُمْ كُونُواْ قِرَدَةً خَـسِئِينَ

(We said to them: "Be you monkeys, despised and rejected") means, "Allah changed their bodies into those of monkeys and swines. The young people turned into monkeys while the old people turned into swine." Shayban An-Nahwi reported that Qatadah commented on,

فَقُلْنَا لَهُمْ كُونُواْ قِرَدَةً خَـسِئِينَ

(We said to them: "Be you monkeys, despised and rejected"), "These people were turned into howling monkeys with tails, after being men and women."

The Monkeys and Swine that exist now are not the Descendants of Those that were transformed

Ibn Abi Hatim recorded that Ibn `Abbas said, "Those who violated the sanctity of the Sabbath were turned into monkeys, then they perished without offspring." Ad-Dahhak said that Ibn `Abbas said, "Allah turned them into monkeys because of their sins. They only lived on the earth for three days, for no transformed person ever lives more than three days. They did not eat, drink or have offspring. Allah transformed their shapes into monkeys, and He does what He wills, with whom He wills and He changes the shape of whomever He wills. On the other hand, Allah created the monkeys, swines and the rest of the creation in the six days (of creation) that He mentioned in His Book."

Allah's statement,

فَجَعَلْنَـهَا نَكَـلاً

(So We made this punishment an example) means, Allah made the people of this village, who violated the sanctity of the Sabbath,

نَكَـلاً

(an example) via the way they were punished. Similarly, Allah said about Pharaoh,

فَأَخَذَهُ اللَّهُ نَكَالَ الاٌّخِرَةِ وَالاٍّوْلَى

(So Allah, seized him with punishing example for his last and first transgression) (79:25). nAllah's statement,

لِّمَا بَيْنَ يَدَيْهَا وَمَا خَلْفَهَا

(for those in front of it and those behind it) meaning, for the other villages. Ibn `Abbas commented, "Meaning, `We made this village an example for the villages around it by the manner in which We punished its people."' Similarly, Allah said,

وَلَقَدْ أَهْلَكْنَا مَا حَوْلَكُمْ مِّنَ الْقُرَى وَصَرَّفْنَا الاٌّيَـتِ لَعَلَّهُمْ يَرْجِعُونَ

(And indeed We have destroyed towns (populations) round about you, and We have (repeatedly) shown (them) the Ayat (proofs, evidences, verses, lessons, signs, revelations, etc.) in various ways that they might return (to the truth and believe in the Oneness of Allah ـ Islamic Monotheism)).(46:27)

Therefore, Allah made them an example for those who lived during their time as well as a reminder for those to come, by preserving their story. This is why Allah said,

وَمَوْعِظَةً لِّلْمُتَّقِينَ

(and a lesson for Al-Muttaqin (the pious)), meaning, a reminder. This Ayah means, "The torment and punishment that this village suffered was a result of indulging in Allah's prohibitions and their deceit. Hence, those who have Taqwa should be aware of their evil behavior, so that what occurred to this village does not befall them as well." Also, Imam Abu `Abdullah bin Battah reported that Abu Hurayrah said that the Messenger of Allah ﷺ said,

«لَا تَرْتَكِبُوا مَا ارْتَكَبَتِ الْيَهُودُ فَتَسْتَحِلُّوا مَحَارِمَ اللهِ بِأَدْنَى الْحِيَل»

(Do not commit what the Jews committed, breaching what Allah has forbidden, by resorting to the lowest types of deceit.)

This Hadith has a good (Jayid) chain of narration. Allah knows best.