|Praying Hands, Albrecht Dürer c.1508|
This is not a scientific study but one would have expected at least one Christian or Muslim who believes in prayer to be able to say what it's for and what it does.
Of course, there are explanations for why religious people meet up for prayers to be found in psychology. Maslow's 'Heirarchy of Needs' explains it in terms of social or affiliative needs, etc., and Skinner's experiments with operant conditioning with pigeons showed how they become 'religious' and develop rituals when a rewarded is randomly associated with behaviour, so it's not hard to see the attraction of gathering together to pray.
There is also a psychological explanation for private prayer. It's one of Maslow's needs of course - the need for the esteem of others; an affiliative need again. The same reason some lonely children have imaginary friends. Someone to talk to (or rather to talk at, because there is never any reply) as a way of understanding something. Putting it into words often makes it more understandable because you have to analyse the problem in order to explain it. People have reported similar help from talking to a computer program.
The Christian version, the Muslim version and the Jewish version of the Abrahamic god are all supposed to be omniscient and to have plans for the universe. They are also supposed to be omnibenevolent. Muslims refer to their version as infinitely just and infinitely merciful - not that it can logically be both, but that's never stopped them - and not many Christians or Jews would dare to suggest their version is any less perfect that the Muslim one.
It may be that ministers really think that their prayers do good and it may be that frogs imagine that their croaking brings spring.If this is true, these versions of Abraham's god would both have devised perfect plans of which pain, suffering and misery would either not be part, or they would be there for some ultimately good reason (though why a perfect omnipotent god can't create ultimate goodness without some un-goodness on the way remains one of religions' many ineffable mysteries by which these little logical difficulties are avoided).
Robert G. Ingersoll
Is [God] willing to prevent evil, but not able? then is he impotent. Is he able, but not willing? then is he malevolent. Is he both able and willing? whence then is evil?There can only be one reason to pray to an omniscient, omnipotent god: you are telling it you think its plan is imperfect and that you have a better idea.
But what are you actually praying to a god for at all? If the Christian, Jewish and Muslim versions of their god is as they claim there would be nothing to pray for.
The only reason religious people think prayer is necessary is because their god doesn't exist and so isn't creating a perfect universe. The perceived need for prayer is good evidence that there is no god.