Before I start, let me emphasize this is opinion without source evidence other than general personal experience and you can dismiss it at will, although it would be nice to hear why you choose to do so.
We are faced with people of faith who claim their prayers work and they receive guidance from their deity. Further, it doesn't seem to matter how profound or minuscule the subject matter of the prayer - the claim remains that these prayers work.
Now we can easily refute this, because of the absence of evidence, and mock those who continue to pray. We do this without much effort, because we don't believe their deities exist to even hear prayers, let alone answer them. So why are we not convincing? It may be that our human logical thought processes are actually feeding the faithful prayer belief, rather than contradicting its efficacy.
When we have a problem, we perceive that problem from within it. We know all the complexities and contradicting aspects of it, all the tiny nuances of it, we attribute emotional bias randomly and probably disproportionately and we end up with a burden of mixed and mashed information - confusion is almost inevitable. We can't see the wood for the trees.
We may then elect to talk this through with a friend, or via prayer to a deity. Here's where it gets interesting. We can't communicate the jumble as jumble. It has to be sorted out into a tale, so that it can be explained to our friend (or deity). In sorting through our minds to present the information in an understandable way, we go through a logical process of sorting through the mess to narrate a summary of the problem. In doing this, we sift through our jumble and present it in an orderly way.
Because of this, we see our own problem objectively and logically for the first time - in this way, we often see the solution for ourselves. It becomes obvious to us because we have had to rationalize it to express it verbally to a third party. By the time our friend has a chance to respond, very often we have already found the clarity we sought.
Now if you take that moment of clarity, you can attribute it to the above rationalization, or if your friend was your deity and you were praying, you could attribute it to your deity answering your prayer by putting the knowledge into your head.
In the latter case, you would be reinforcing your faith by appearing to have personal evidence of your prayer being answered.
Consequently, technically the act of prayer "works". In reality, it most likely worked because you were consulting yourself and you actually had the solution in your head, just waiting to take shape.
Another statistic I read somewhere (sorry, no link) was that on average, of the five top problems that we have at any one time, around four will reach resolution without our doing anything. Even if we reduce that by half, and estimate two out of five will self-resolve, it's still an interesting factor to be considered. In terms of prayer for all five issues, it might easily appear that the deity in fact resolves two or more of them.
If a devotee of a religion believes they have access to this 'magic', then confirmation bias is almost sure to rear its head. If you've ever been to a bingo hall, lucky charms and lucky ways to arrange your pens abound. I went because I was curious, and I inadvertently moved a 'lucky' doll belonging to a woman. The fury and rage she emanated was apparently not unusual. She had somehow convinced herself that this little lump of plastic was going to magically give her a win. Perhaps she won once when the little doll was placed just so, and that's what created the 'magic'.
Most people are looking for an edge, an advantage in a competitive world. Perhaps for the religious, their religion is provides just that - the 'lucky' edge that gives them that magical advantage.