This book does a good job of tracing the regions very dramatic history through numerous conquests and revolutions down to the 1990s. To give a taste of the action, I'll try summarizing Reudy's description of the Kharjite revolt against Arab conquerors in the mid-700s.
Supposedly, the Berbers who joined Islam as comrades in arms were to be welcomed as full members of the Islamic brotherhood. Many Arabs, however, felt that the Berbers lacked all marks of higher Arabic civilization. To them, the Berber’s conversion seemed an opportunistic gesture, for participating in plunder while evading the tax on unbelievers. Besides, Arab governors needed revenue with which to rule. Therefore they re-imposed the unbelievers’ tax on Berber Muslims. And at this insult, the Bebers rose to fight again, taking up the banner of an outlawed Islamic group known as the Kharjite sect.
The Kharjites did not recognize the hereditary Umayyad caliphs of Islam. They claimed the caliph should not simply inherit his position, but should be chosen by a consensus of those learned in the faith. The leader should be the greatest exemplar of spirituality in each generation, be that person a prince or a slave. As the Quran said, “The most righteous among you is the most honored before God.”(49:13). The original Kharjites fled persecution in Persia and Iraq by coming to North Africa. In meeting these exiled heretics, the Berbers found “other Muslims by whom they were treated and regarded as equals.” It was like a spark catching the pre-Saharan bush aflame.
The Kharjite revolt of 740 drove the Arabs completely out of northwest Africa. And aside from an Arab re-conquest of Tunisia, no Arabia-based empire ever ruled the Maghreb again. Unfortunately however, the Kharjites’ opposition to central rule left them prone to division. Without an autocratic enemy to oppose, the Kharjites turned on each other in vicious battle over which leader was most virtuous For many in that time and place, such difficulties were enough to discredit primitive democracy.