Note: the word imam (lower case) is used to refer to religious prayer leaders and clerics. This term is applied in Sunni as well as in Shi’a teaching.
In a specifically Shi’a context, though, the Imam (capitalised) refers to one of the divinely appointed successors to the Prophet Muhammad from his progeny (i.e. children/descendants). There were twelve Imams who lead Islam after Prophet Muhammad. According to Shi’a Islam, the selection of a religious leader, prophet or not, is a divine matter decided by Allah alone. This is seen in the Qur’an when Allah tells His angels: “Indeed I am going to set an authority on the earth.” (Qur’an 2:30)
The Imam is someone who, in the absence of the Prophet, acts as the leader of the Muslim community. His role includes religious and secular affairs, and while he is not a prophet, the Imam is responsible for protecting the message and teachings of the Prophet. Unlike prophets, they do not receive revelation but receive divine inspiration. Like prophets, they are sinless, free from error, and able to interpret the scripture of the prophet that they follow based on the God-given gift of knowledge, which is open to them alone. Hence we can say that Prophet Muhammad brought the final revelation and the Imams protect its interpretation.
Prophet Muhammad, through divine designation chose the first Imam. The subsequent Imams were chosen by the Imam previous to them, hence, Imam Ali chose Imam Hasan, Imam Hasan chose Imam Husayn, and so on. This is known as nass – divine designation of an Imam.
The doctrine or teaching of Imamah is what separates Shi’a Muslims from other forms of Islam since it holds to the idea that Allah continued to choose people for guidance after Prophet Muhammad. Although they are not prophets who brought revelation, obedience to them is equal to Prophet Muhammad and Allah: “O you who have faith! Obey Allah and obey the Apostle and those vested with authority among you.” (Qur’an 4:59)