Jennifer Michael Hecht said this quote

Prayer is based on the remote possibility that someone is actually listening; but so is a lot of conversation. If the former seems far-fetched, consider the latter: even if someone is listening to your story, and really hearing, that person will disappear from existence in the blink of a cosmic eye, so why bother to tell this perhaps illusory and possibly un-listening person something he or she is unlikely to truly understand, just before the two of you blip back out of existence? We like to talk to people who answer us, intelligently if possible, but we do talk without needing response or expecting comprehension. Sometimes, the event is the word, the act of speaking. Once we pull that apart a bit, the action of talking becomes more important than the question of whether the talking is working-because we know, going in, that the talking is not working. That said, one might as well pray.