In 1375, craving solitude from the exhausting business of politics, Ibn Khaldūn took the most momentous step of his life: he sought refuge with the tribe of Awlād ʿArīf, who lodged him and his family in the safety of a castle, Qalʿat ibn Salāmah, near what is now the town of Frenda, Algeria. There he spent four years, “free from all preoccupations,” and wrote his massive masterpiece, the Muqaddimah, an introduction to history. His original intention, which he subsequently achieved, was to write a universal history of the Arabs and Berbers, but before doing so he judged it necessary to discuss historical method, with the aim of providing the criteria necessary for distinguishing historical truth from error. This led him to formulate what the 20th-century English historian Arnold Toynbee has described as “a philosophy of history which is undoubtedly the greatest work of its kind that has ever yet been created by any mind in any time or place,” a statement that goes even beyond the earlier eulogy by Robert Flint:
As a theorist on history he had no equal in any age or country until Vico appeared, more than three hundred years later. Plato, Aristotle and Augustine were not his peers . . . .
But Ibn Khaldūn went even further. His study of the nature of society and social change led him to evolve what he clearly saw was a new science, which he called ʿilm al-ʿumrān (“the science of culture”) and which he defined thus:
This science . . . has its own subject, viz., human society, and its own problems, viz., the social transformations that succeed each other in the nature of society.
Indeed it is not too much to claim, as did a contemporary Arab scholar, Sāṭiʿ al-Ḥuṣrī, that in Book I of the Muqaddimah, Ibn Khaldūn sketches a general sociology; in Books II and III, a sociology of politics; in Book IV, a sociology of urban life; in Book V, a sociology of economics; and in Book VI, a sociology of knowledge. The work is studded with brilliant observations on historiography, economics, politics, and education. It is held together by his central concept of ʿaṣabiyyah, or “social cohesion.” It is this cohesion, which arises spontaneously in tribes and other small kinship groups, but which can be intensified and enlarged by a religious ideology, that provides the motive force that carries ruling groups to power. Its inevitable weakening, due to a complex combination of psychological, sociological, economic, and political factors, which Ibn Khaldūn analyzes with consummate skill, heralds the decline of a dynasty or empire and prepares the way for a new one, based on a group bound by a stronger cohesive force.
It is difficult to overstress Ibn Khaldūn's amazing originality. Muhsin Mahdi, a contemporary Iraqi-American scholar, has shown how much his approach and fundamental concepts owe to classical Islamic theology and philosophy, especially Averroism. And, of course, he drew liberally on the historical information accumulated by his predecessors and was doubtless influenced by their judgments. But nothing in these sources or, indeed, in any known Greek or Latin author can explain his deep insight into social phenomena, his firm grasp of the links binding the innumerable and apparently unrelated events that constitute the process of historical and social change.
One last point should be made regarding his basic philosophy of history. Clearly, for Ibn Khaldūn, history was an endless cycle of flowering and decay, with no evolution or progress except for that from primitive to civilized society. But, in brief descriptions of his own age, which have not received as much attention as they deserve, he showed that he could both visualize the existence of sharp turning points in history and recognize that he was witnessing one of them: “When there is a general change of conditions . . . as if it were a new and repeated creation, a world brought into existence anew.” The main cause he gives for this great change is the Black Death, with its profound effect on Muslim society, but he was fully aware of the impact of the Mongol invasions, and he may also have been impressed by the development of Europe, the merchants and ships of which thronged the seaports of North Africa and some of the soldiers of which served as mercenaries in the Muslim armies.