Walaya involves various meanings, so it must be analysed step by step.
1. The first meaning is “protection” (from God to man). In the Qur’an it is said that “God is the protector (wali) of the believers. He brings them out of darkness and leads them towards the light” (2:257) and “Protection (al-walaya) belongs to God, the True One” (18:44). A related term is mawla (protector, lord), as in the following prayer that appears in a Qur’anic verse: “Forgive us and have mercy on us. You are our Protector'' (wa’ghfir lana wa’rhamna. Anta Mawlana).
2. The second meaning is “relation of friendship and proximity” (of the Imam with God). Another verse says: “The Friends of God (awliyaʾ Allah) have no fear and no pain” (10:62). According to the Shiʿi interpretation the “Friends of God” are the Imams. That is why we Ismailis say, with all other Shiʿa, “Ali is the Friend of God” (‘Ali Waliyu’llah). Others, such as the Sufis, say that the awlya are the mystics.
3. The third meaning is similar to the first one, but applied to the relation between the Imam and the believer. In this sense, we say that the first duty is to recognise the Imam’s walaya, that is to say, his authority and sovereignty. An equivalent of this sense is wilaya (in Persian velayat – mandate or power). It is written in the Qur’an: “Your Friend (wali) is only God, his Messenger and those believers who perform the prayer and pay alms while they prostrate” (5:55). It is said that this verse was revealed on an occasion when Hazrat Ali was praying in the mosque, at which moment a poor man came to him begging; then, Ali gave him his ring while doing the prostration. Later, at Ghadir Khumm, the Prophet Muhammad declared Hazrat Ali as successor saying: “For whom I am the master (mawla), now Ali is his master.” For this reason, we refer to each Imam as “our master” (mawlana), and to our current Imam as “our master the present Imam” (Mawlana Hazir Imam).
4. The fourth meaning is derived from the second one, and is applied to the relation between a person and his/her Imam; as such it means “love,” “devotion” and “loyalty” to the Imam. In fact, Mawlana Muhammad al-Baqir declared that walaya, devotion to the Imam, is the most excellent of all the pillars of Islam.
All of these meanings make walaya one of the most important concepts for the Ismailis.