Ibn Khaldun wrote al-Muqaddima, a theory of history, society, and knowledge that discusses how asabiyya, states, and scholarly institutions rise and fall. Maliki-trained, he served in North African and Mamluk courts.
His observations on madhhab continuity and scholarly class are still read in discussions of why Muslims followed schools of law.
Choosing a madhhab
SeekersGuidance
Why the four schools matter historically.