1. There are a lot more small organizations at any given time than large ones. There were only two Caliphates at the time of the Fatimid Caliphate (the other being the Sunni Abbasid Caliphate, to which we owe Western Civilization, such as it is), and they covered the entire Middle East. But at the same time and in the same place there were thousands of schools and universities, some of which did get blown up by catastrophes (like the House of Wisdom in Baghdad) and some of which did not.
2. There are a lot of catastrophes that are harder for a big organization like the Fatimid Caliphate to absorb than for a smaller organization like al-Azhar University. More generally there are certain kinds of organizations, such as universities, that are very resilient.