In the first 150 years of Islam, there were numerous madhhahib; several of the Sahābah ("companions" of Muhammad) are credited with founding their own.
madhhab |
The reason why the people of Morocco took up the madhhab of Imam Malik, is that the people of Morocco and Spain were originally upon the madhhab of al-Awza’i, and likewise the Sham, from where they were conquered.
Differences arise because of different interpretations of the Islamic legal sources by the different schools of law (madhhabs) in Sunni Islam, and by different legal traditions within Shia'ism.