Wikipedia
Imamah is the Shia Islam doctrine (belief) of religious, spiritual and political leadership of the Ummah. The Shia believe that the Imams are the true Caliphs or rightful successors of Muhammad, and further that Imams are possessed of divine knowledge and authority ( Ismah) as well as being part of the Ahl al-Bayt, the family of Muhammad. These Imams have the role of providing commentary and interpretation of the Quran as well as guidance to their tariqa followers as is the case of the living Imams of the Nizari Ismaili tariqah.
According to Nasir al-Din al-Tusi, the Imam is a means through which humans receive divine grace, because "He brings men closer to obedience (of Allah) and keeps them away from disobedience." As fulfilling the human being is his wish, it is logical that God appoints Imams to subject man to his wishes. So his existence and his deeds display two forms of grace of God toward man.
The doctrine of the Imamate in Isma'ilism differs from that of the Twelvers because the Isma'ilis had living Imams for centuries after the last Twelver Imam went into concealment. They followed Isma'il ibn Jafar, elder brother of Musa al-Kadhim, as the rightful Imam after his father, Ja'far al-Sadiq. The Ismailis believe that whether Imam Ismail did or did not die before Imam Ja'far, he had passed on the mantle of the imamate to his son Muhammad ibn Isma'il as the next imam.