The Abbasids family established their claim on the Caliphate on the basis that they were descended from the Prophet Muhammad's uncle, Abbas. They overthrew the Ummayads with large-scale Shia support. Why did the Shias support the Abbasids if they (the Shia) believed the Caliphate rightfully belonged to the descendants of Ali? Further to this, why did generals like Abu Muslim place the Abbasid family on the throne in the first place, as opposed to the Alids?
And just a further question—why didn't the Shia Buyids place an Alid on the throne after they took control of the Caliphate? They kept the Abbasids around as puppets, but surely they could have done the same with the Imams?