The caliphate is the central political institution of Sunni Islam, and the disagreement over what the office actually is has never been settled since it began.
Contract, or usurpation
The Arabic khilafa means succession, and the question of what the successor succeeds to, political leadership only or religious authority as well, is present from the start. Classical Sunni theory, as al-Mawardi set it out in the eleventh century, made the office contractual: the caliph is chosen by those qualified, receives the pledge of allegiance, must meet conditions of knowledge, justice and descent from Quraysh, and is owed obedience while he upholds the law. Al-Mawardi wrote this when the caliph had no army and no revenue, so the theory should be read as an argument about legitimacy made under conditions that contradicted it. Twelver Shia doctrine rejects the premise entirely: authority belonged by designation to Ali and the Imams, and the historical caliphate is therefore a usurpation.
Abolition, and what followed
The Ottoman sultans claimed the title, most strongly in the nineteenth century, and the Turkish Grand National Assembly abolished it in March 1924. No institution has since been generally recognised in its place, and announcements of a restored caliphate by armed groups have been rejected by the great majority of Muslim scholarly authorities. The abolition provoked a substantial literature, of which the argument of Ali Abd al-Raziq that the caliphate was never a religious institution at all is the most cited, and was condemned at al-Azhar when it appeared.