Countries cutting off their relationship with the Abbasid Khilaafat
Q: Please advise:
1. Why had Al-Andalus, and later, Al-Maghrib, cut off their relationship with the Abbasid Khilaafat of Baghdad in order to become independent states?
2. Was their above action correct according to the Sharia?