Complex sentence: Muhammad's migration to Medina shifted the focus away from Mecca, this focus moved still more when Ali, the fourth caliph took power choosing Kufa as his capital.
Split into simpler sentences: Muhammad's migration to Medina shifted the focus away from Mecca. This focus moved still more when Ali, the fourth caliph, took power choosing Kufa as his capital.