Inhabited since prehistoric times by Amazigh (Berbers) populations, Morocco and its territory have known Phoenician, Carthaginian, Roman, Vandal, Byzantine, and Arab settlements.
It was in 788, during his exile that Idris I, fleeing the persecutions of the Abbasid caliphate, gave birth to a state in the Maghreb al-Aqsa (extreme Maghreb). Since then, Morocco has always kept, if not absolute independence, at least very strong autonomy.
The attraction of wealth from trade from the South (the Sahara) to the North (the West) will attract the desires of various tribes with the crossroads city of Marrakech which will naturally become the capital of various dynasties, in particular, those coming from the South ( Almoravids, Almohades, Saadiens); this is the reason why the entire history of Morocco (from the Idrissids to the Alaouites) was marked by the trade-in wealth from the South to the North.
The history and origin of Morocco were, are, and will be marked by the link with the Sahara.