***Disclaimer: I am not a very learned historian and do not know any of the relevant languages for studying these things, nor have I read translations of the relevant texts. This post is based on various things I read in books and online.***
The Zoroastrian sacred scriptures, known as the Avesta, are variously said to have been revealed to or composed by the prophet Zarathustra (as) at some time between 150 BC and 7000 BC. According to Zoroastrian doctrine, the Avesta originally contained 21 books, most of which have been lost. Only one book of the Avesta is said to have survived in its entirety. What remains of them is sometimes said to be less than a tenth of the original Avesta, which contained 2,000,000 verses according to the ancient Greek author Pliny. Others say that about a fourth of the Avesta have survived.
The destruction of the Avesta has usually been attributed to Alexander the Great and the Arab conquerors of Persia. Some authors have considered later Muslim rulers of Iran and the Mongols to be more responsible than the early Arab rulers.
When Alexander the Great conquered Persia in the fourth century BC, he is said to have destroyed one copy of the Avesta and taken the other to distribute it among the Greeks. After the Zoroastrians regained control of Persia, they recompiled much of the Avesta from various fragments that had been memorized or written down. It is unknown how much of the Avesta they were able to compile.
The next disaster for the Avesta was the Arab conquest under the Rightly Guided Caliph Umar (ra). As the story goes, a general asked Umar (ra) what to do with the library of the Persian capital, Ctesiphon. Umar is said to have replied “If the books contradict the Quran, they are blasphemous, and on the other hand if they are in agreement with the Quran, they are not needed, as for us only Quran is sufficient.” Then the books were destroyed, including the Avesta. But this story is fabricated. For Sunni Muslims, it should be sufficient to acknowledge that Umar (ra) was too intelligent and righteous to do such a thing. Even though Muslims do not need the Avesta or other Zoroastrian texts, this would be no excuse for destroying them en masse without even analyzing their contents; Umar (ra) was not stupid enough to do such a thing and intentionally risk obliterating divine revelations with no permission from Allah. There are also other reasons for rejecting this story. First of all, the same story is told in two versions, one with the Library of Ctesiphon in Persia, and the other with the Library of Alexandria in Egypt. This is a sign that one or both of the stories is fabricated. Secondly, the Zoroastrians wrote detailed summaries of the whole Avesta several centuries after the Arab conquest of Persia. Some scholars think this is proof that most of the books of the Avesta were still extant at that time.
As the centuries passed, relations between the Muslim rulers of Iran and their Zoroastrian subjects worsened. The Zoroastrians were persecuted increasingly, and it may have been at this point that most of the Avesta were lost. Then, in the 13th century, the Mongols under Genghis Khan and his successors conquered Iran and many surrounding areas. They were extremely destructive. In 1258, Genghis Khan’s grandson Hulagu sacked Baghdad and destroyed the libraries, which some believe contained copies of the Avesta. Zoroastrians were persecuted very harshly and had to flee to the outskirts of Iran, or abroad.
The Mongols lost control of Iran in 1335, and Iran was often in a state of chaos and warfare over the following centuries. The Zoroastrians continued to be marginalized and persecuted, which made it very difficult or impossible for them to search for or compile whatever remained of the Avesta in an organized manner.
Many other Zoroastrian texts were also lost over the centuries, including commentaries and translations of the Avesta. To this day, the history and fate of the majority of the Avesta is shrouded in mystery, just like many other things about them, such as when they first appeared and how long they were. Even the meaning of the extant Avesta is highly debated, even among Zoroastrians.