Ibn Khaldun wrote the work in 1377 as the introduction chapter and the first book of his planned work of world history, the Kitābu l-ʻibar ("Book of Lessons"; full title: Kitābu l-ʻibari wa Dīwāni l-Mubtada' wal-Ḥabar fī ayāmi l-ʻarab wal-ʿajam wal-barbar, waman ʻĀsarahum min Dhawī sh-Shalṭāni l-Akbār, i.e.: "Book of Lessons, Record of Beginnings and Events in the history of the Arabs and Foreigners and Berbers and their Powerful Contemporaries"), but already in his lifetime it became regarded as an independent work on its own.
Ibn Khaldun starts the Muqaddimah with a thorough criticism of the mistakes regularly committed by his fellow historians and the difficulties which await the historian in his work. He notes seven critical issues:
"All records, by their very nature, are liable to error...
Against the seventh point (the ignorance of social laws) Ibn Khaldun lays out his theory of human society in the Muqaddimah.
Sati' al-Husri suggested that Ibn Khaldun's Muqaddimah is essentially a sociological work, sketching over its six books a general sociology; a sociology of politics; a sociology of urban life; a sociology of economics; and a sociology of knowledge.