The formula Allah-Muhammad-Ali, rendered Hakk-Muhammad-Ali in Turkish Alevi usage, opens the cem, the central Alevi communal gathering, and appears throughout Bektashi devotional poetry and ritual formula. It does not simply honor Muhammad and Ali as important men in the history of Islam; it presents the three names as a single reality showing itself in three manifestations, God, his Prophet and his Prophet's designated successor, bound together rather than ranked in strict sequence. The doctrine draws heavily on the vocabulary of Sufi mysticism, particularly on ideas about the unity underlying apparent multiplicity, and on Shia veneration of Ali and the Ahl al-Bayt, the Prophet's household, without matching either source exactly. Alevism and Bektashism read scripture and religious authority esoterically, batini rather than zahiri, holding that the outward text and law point toward an inner truth that ritual, poetry and the guidance of a living teacher disclose more directly than legal study does.
The doctrine is inseparable from the reverence both traditions give Ali specifically, expressed in poetry, in the semah ritual dance, and in devotional formulas repeated in gatherings that, unlike Sunni or Twelver Shia worship, take place in a cemevi or dergah rather than a mosque, with men and women present together. Historians of the tradition trace the formula's crystallization to the Sufi orders and dervish lodges of medieval Anatolia, where devotion to Ali circulated widely among mystically inclined communities well before Alevism and Bektashism took the more distinct institutional shapes scholars describe today.