People want (need?) explanations for the unexplainable.  Just started reading The City in History which discusses the evolution of the priestly class as part of the mechanism for societal control. Prayer, like meditation, does have an internal effect; there's a school of thought that it can have collective effects as well.