The Shia case begins with a claim about an event. Returning from his final pilgrimage in 632, Muhammad halted the caravan at a pool called Ghadir Khumm and, taking Ali by the hand, said that whoever holds me as his mawla holds Ali as his mawla. The report appears in Sunni collections as well as Shia ones; the dispute is over the word, which can mean friend, patron, or master and protector. Shia tradition reads it as investiture. Sunni tradition reads it as an affirmation of affection and standing, occasioned by complaints about Ali's conduct on campaign.
From that reading follows the doctrine of the Imamate. Leadership of the community is not a matter for the community to decide: God appoints, through the Prophet and then through each Imam designating his successor, a process called nass. The Imam is the proof of God on earth, the authoritative interpreter of the Quran's meaning, and the guarantor that guidance continues after prophecy has ended. Most Shia traditions hold him masum, protected from sin and error, and many hold that he possesses knowledge transmitted from the Prophet rather than acquired.
This makes the Imamate a category with no Sunni equivalent. A Sunni caliph is a ruler who may be pious or otherwise; a Shia Imam is a locus of religious authority whether or not he ever holds political power, and most of the Imams did not. The doctrine developed alongside a history of dispossession, and the martyrdom of Ali's son Husayn at Karbala in 680, killed with his companions by the forces of the Umayyad caliph Yazid, became the tradition's central narrative and the subject of the annual Ashura commemorations.