Perhaps the most compelling explanation of the origins of religions using purely psychological explanations is the theory of religious figures having a high incidence of frontal lobe epilepsy. Of course, this doesn't explain their rise in influence and - which I think should be left to historians since it goes beyond the realm of science that could prove to be reductive and merely speculative in this case.
However, there is a tremendous amount of literature of the psychology of religion, which would be difficult to summarize in one answer. The reason behind this is that this is a multidisciplinary subject involving social psychology, linguistics, evolutionary psychology, cognitive psychology and so forth - none that can alone provide a compelling answer. The Wikipedia page on this topic can be very helpful. I have tried to quote some sources regardless:
This quoted paragraph gives a flavor of the different ways to answer this problem. In this case, the author mentions the semantic memory theory of religious transmission:
Where religious ideas are expressed in words (e.g. transmitted through
oratory), it is likely that the orators themselves will rise above the
common herd. Most religious traditions of this sort have cel- ebrated
leaders, who may take the form of gurus, messiahs, prophets, divine
kings, high priests, mediums, visionaries, disciples, or simply great
evangelists or missionaries. The very fact that there are so many
different types of, and terms for, religious leadership is an index of
how widespread and important the phenomenon is. Partly through their
skills as orators, these leaders become marked out as special. But, at
the same time, their pronouncements (real or attributed) pro- vide the
central tenets of a belief system, and their deeds become the basis
for widely-recounted religious narratives, transmitted orally. Both
forms of knowledge are stored primarily in semantic memory.
Modes of Religiosity: a cognitive theory of religious transmission.
Whitehouse, H. (2004).
Walnut Creek, CA: AltaMira Press.
"Religious Thought and Behavior as By-Products of Brain Functions"
Trends in Cognitive Sciences 7, pp 119–24
Inside the Cult: Religious innovation and transmission in Papua New Guinea.
Whitehouse, H. (1995).
Oxford: Clarendon Press.
To get a picture of the TLE theory of the origins of religious figures, you should try understanding the behavioral changes caused by Temporal Lobe Epilepsy that involve intense religious experiences and hypergraphia, the intense desire to write - which could account for the cross-cultural production of religious scriptures:
Revered in some cultures but persecuted by most others, epilepsy
patients have, throughout history, been linked with the divine,
demonic, and supernatural. Clinical observations during the past 150
years support an association between religious experiences during
(ictal), after (postictal), and in between (interictal) seizures. In
addition, epileptic seizures may increase, alter, or decrease
religious experience especially in a small group of patients with
temporal lobe epilepsy (TLE). Literature surveys have revealed that
between .4% and 3.1% of partial epilepsy patients had ictal religious
experiences; higher frequencies are found in systematic questionnaires
versus spontaneous patient reports. Religious premonitory symptoms or
auras were reported by 3.9% of epilepsy patients. Among patients with
ictal religious experiences, there is a predominance of patients with
right TLE. Postictal and interictal religious experiences occur most
often in TLE patients with bilateral seizure foci. Postictal religious
experiences occurred in 1.3% of all epilepsy patients and 2.2% of TLE
patients. Many of the epilepsy-related religious conversion
experiences occurred postictally. Interictal religiosity is more
controversial with less consensus among studies. Patients with
postictal psychosis may also experience interictal hyper-religiosity,
supporting a "pathological" increase in interictal religiosity in some
Spirituality and religion in epilepsy.
Devinsky O1, Lai G.
Epilepsy Behav. May 2008 ; 12(4):636-43.
"Norman Geschwind's contribution to the understanding of behavioral changes in temporal lobe epilepsy: the February 1974 lecture".
Devinsky J, Schachter S (August 2009)
Epilepsy Behav (Biography, History article) 15 (4): 417–24.
"Hypergraphia in temporal lobe epilepsy. 1974."
Waxman, SG; Geschwind, N (March 2005).
Epilepsy & behavior : E&B 6 (2): 282–91.