...To give you an idea of why Averroës is so important, both Christian and Jewish philosophers built upon his work, which first involved commentaries on Aristotle, but grew into a doctrine that a proposition may be philosophically true but religiously or morally false, which he then applied nearly as universally as Aristotle's writings did. Hence his works were major advances in philosophy. A century later Western philosophers held Averroës and Aristotle in equal esteem.
However, in Islam the fate of Averroës works was tied into the decline of twelfth-century Islamic Civilization as a whole by Durant [The Age of Faith, Chapter XIV, VIII (1950)]:In 1194 the Emir Abu Yusuf Yaqub al-Mansur, then at Seville, ordered the burning of all works by Averroës except a few on natural science; he forbade his subjects to study philosophy, and urged them to throw into a fire all books of philosophy wherever found. These instructions were eagerly carried out by the people, who resented attacks upon a faith that for most of them was the dearest solace of their harassed lives. About this time Ibn Habib was put to death for studying philosophy. After 1200 Islam shunned speculative thought. As political power declined in the Moslem world, it sought more and more the aid of the theologians and lawyers of orthodoxy. That aid was given, but in return for the suppression of independent thought. Even so, the aid did not suffice to save the state. In Spain the Christians advanced from city to city, until only Granada remained Moslem. In the East the Crusaders captured Jerusalem; and in 1258 the Mongols took and destroyed Baghdad.
The grammar text, then, must have been saved from al-Mansur's destruction order. Presumably, the Mauritanians could afford to do so because they were far away and honored learning and scholarship. Who knows what other treasures may be recovered in the near future, and their impact upon philosophies and relgions worldwide?