In Arabic, Maskh means for something to change form to an uglier one. In the Quran and Islamic tradition, this term refers to a specific divine punishment which was sent upon the wrongdoers and wrongdoing nations in the past (of course not all wrongdoers, but those who committed certain wrong acts) which can be called metamorphosis.
Those who underwent metamorphosis acquired the forms of apes and monkeys; meaning the animalistic form of their wrong deeds would take over their human form, making them people with animalistic features and forms.
Most commentators of the Quran consider the metamorphosis it speaks of, real metamorphosis, meaning that the individual would actually turn into an animal, while some Sunni commentators believe it was a change in the nature and the insides of such individuals, meaning that the individual would acquire an animalistic nature on the inside, not that there was any change in form.
The reason for some being inflicted with such a punishment is for others to learn a lesson. Hadiths tell us that those who underwent this punishment because of their wrong acts didn’t survive for more than several days and that the animals we see today, aren't the descendants of the people who underwent metamorphosis, but the offspring of normal animals.
In Quranic terms and Islamic teachings, maskh or “metamorphosis” refers to a type of punishment that Allah (swt) miraculously utilized against past people and nations. Some of the outcomes of this method of punishment are the chastisement of those whom it takes place for, them being an example for others and showing the bad consequences of the sinners to the rest of the people.
The following points contribute to better understanding the issue:
1- What is maskh (metamorphosis), what is it like? How does it take place?
Metamorphosis means for a human to change to an animal form. How is that possible? Through doing different deeds and repeating them, people obtain one of various forms (surah), meaning that for instance, as a result of good and sincere deeds, they move towards the angelic and high spiritual soul [which is one of these forms], and as a result of bad deeds, they move towards the form and spirit of that bad deed [which is another form]. Our deeds determine what soul and form we obtain. In many ethical hadiths, anger has been compared to fire. In the Quran, unjustly consuming the wealth and belongings of orphans has been considered eating fire. These expressions and passages aren’t exaggeration or metaphors; they are making us aware of the true essence and form of these actions and what they actually are. Therefore, if one overdoes himself in sin, the true essence of these sins can turn into a permanent state for him, being resurrected with it on the Day of Judgment. Imam Baqir (as) has been reported saying: “Those who deny Allah (swt) and His prophet (pbuh), will be raised from their graves and resurrected in the form of pigs and monkeys.” “On [the other] hand, there is no reason to say that the inner forms people acquire which will manifest on the Day of Judgment won't manifest in this world at all.” When metamorphosis takes place, the person doesn’t turn into an animal, but the animalistic form covers and takes over the human form, yet both are still there, hence a person who has undergone metamorphosis, not something that has undergone it and now totally lacks any form of humanity.”
There is also other reasoning for this matter, because as was said before, metamorphosis or maskh is a form of punishment [so if the person was to cease to be human anymore, it wouldn’t be considered a punishment anymore]. The Prophet of Islam (pbuh) says: “Allah (swt) made some nations the subject of maskh as a consequence for their disobedience towards the apostles and imams after the prophets.” If they are truly to be punished, they have to maintain their humanity while partly being animal at the same time, so that they can comprehend the fact that they have partly transformed into animals, so that what is happening to them can be called “punishment”.
Concerning this subject, Imam Ridha (as) has said: “Allah (swt) made those who were transformed into animals a lesson for others, and the reason for there being people whose forms [they have been created with] have changed, [He also] left signs of humanity in them to show that they are people who have been inflicted by Allah’s (swt) wrath”, meaning that both they and others know that they are humans, the only thing being that their animalistic form has taken over their human form.
In a hadith by Imam Sajjad (as), it has been said: “After the sin the Jews committed on the Sabbath, disobeying Allah’s (swt) command not to fish on that day, He changed their forms to monkeys.” [The Quran says:] “And certainly you know those of you who violated the Sabbath, whereupon We said to them," Be you spurned apes”. After this incident, a group of believers who were neighbors to the city of those who had been transformed came to see them. Some of them who new those who had undergone metamorphosis before it would say: “I know you! Aren’t you so and so, the son of so and so? And the monkey would nod in tears indicating that he was him.”
2- Are there different types of metamorphosis?
According to most commentators, the metamorphosis mentioned in the Quran about apes and pigs is true and real metamorphosis, meaning that the person undergoing it actually would turn into a pig or ape. Yet there is a small group of Sunni commentators, such as Sheikh Muhammad Abdoh and others, who believe the metamorphosis mentioned in the Quran is one merely related to the nature and inside of individuals, like the verse in the Quran [which isn't speaking of metamorphosis and is only an example of figurative speech] that says: “کمثل الحمار یحمل اسفارا”. This verse isn't saying that those who were entrusted with the Torah yet failed to uphold and apply it underwent metamorphosis; what it is saying is that those who were so, are like the donkey on the inside and in nature.
3- How was the reproduction of those who went through metamorphosis; were their children like themselves or like normal humans?
Such a question can't be answered by genetic or experimental sciences; basically these sciences aren’t capable of proving such issues, because if their generation was to remain with an animal form, they wouldn’t be distinguishable from other animals, and even if there was to be a difference between them and other animals, there is no proof that their generations continued after them and didn’t cease to exist.
Nevertheless, this question has been answered in our hadiths. Imam Sajjad (as) says: “Those who underwent metamorphosis were alive for three days, and were then cast to the sea by strong winds and rain; none of them survived more than three days. None of the animals you see today are their descendants, although they may be similar to them.” One question that might come up is that there are hadiths that say dogs, pigs and monkeys are haram because of being the animals others transformed into [as punishment]; doesn’t that imply that their generations continued after them? This might be a good question but it has an answer. Such hadiths are trying to say: “Because of the harmful effects the meat of these animals have, and in respect for Allah’s (swt) punishment and in order for the people not to become fond of these animals, thus taking Allah’s (swt) punishment lightly, they have become haram, not that they are haram because of being the descendants of those punished.”
 For further information, see: Translation of Al-Mizan, vol. 1, pg. 310 and on.
 Al-Mizan, vol. 1, pg. 311.
 Mi’rajul-Sa’adah, the chapter on the reproach of anger, pg. 172.
 Safinatul-Bihar, vol. 4, pg. 377.
 Al-Mizan, vol.1, pg. 311.
 Safinatul-Bihar, vol. 4, pg. 376.
 Tafsir Nurul-Thaqalain, vol. 1, pg. 86.
 “و لقد علمتم الذین اعتدوا منکم فی السبت فقلنا لهم کونوا قردة خاسئین” Baqarah:65.
 Mulla Muhsin Faydh, Tafsir Safi, vol. 1, pg. 620.
 Muhammad Jawad Mughinah, Tafsir Kashif, vol. 1, pg. 121.
 Tafsir Safi, Ibid.
 Safinatul-Bihar, vol. 4, pg. 375.