The nature of prayer is a complicated one, because there is
lots of bunk. For me the philosophy of prayer is quite simple:
Prayer is for us not for God, it impacts our outlook and
framework. By virtue of the change we make on ourselves we can influence
how we are cosmically treated. This is perfectly rational, good prayer is
good as an end, not a means.
Therefore, hocus pocus does not work. Iyun Tefilah does not
work. Kishuf (magic) does not work. Prayer on behalf of others does not work. (Although
if they ask for prayer on their behalf it may. The concept of tzadik ben
tzadik is that you associate with someone ask for their advice, it too is an
end in and of itself.)
There are no shortcuts. It also explains certain
halachot, like necessity for thoughtfulness before wearing tefillin and certain
rishonim who argue one should not pray in the improper frame of mind.
Further, the gemara says there are three keys that God maintains, the key to
parnash, to child rearing and to tchiat hameitim. These are random events
that are totally beyond our control, everything else is in our control. Rav Schachter tells the story of when he visited the Steipler for a bracha when he
and his wife were having difficulty having a child. The Steipler said OK. Then
R Schachter asked for a bracha for success in learning, and the Steipler said
what on earth can I offer you. Sit and learn and you will be successful, don’t
sit and learn and you won’t. This is similar to the gadol offering the “segula”
of washing the dishes and making the beds for a good marriage.
Bottom line, humans clamor for shortcuts and are inherently
superstitious. That is the very definition of avodah zara.