God established a law in creation: when we awaken ourselves to approach the Almighty and request a blessing from Him, He, in turn, is aroused from above to bestow good on us, according to our needs and the world’s needs. This is mentioned in the Zohar in many places.
In other words, even when an individual or the world is worthy of God’s bounty, it is sometimes withheld until man knows his predicament and prays to God from the depths of their hearts.
There are two types of prayer. The first is for the continuous existence of the world; without prayer, the world would cease to exist. This kind of prayer parallels the Tamid sacrifice, the merit of which sustains the heavens and the earth (see Ta’anit 27b).
The second type of prayer concerns specific circumstances, such as when disaster strikes and people pray for salvation, or when people pray for something they desire.
Every prayer has an influential effect, as Rabbi Ĥanina says, “The prayers of one who prays for a long time do not return unanswered” (Berakhot 32b). Sometimes the effect is immediate, and at other times in the distant future; sometimes the prayer is answered completely, other times partially. As the Sages say (Devarim Rabba 8:1), “Great is prayer before God. Rabbi Elazar says, ‘If you want to know the power of prayer – if it does not accomplish all it is meant to do, it at least achieves half.’” God is the One Who knows how to help and support a person. Sometimes, for various reasons, one’s misfortune is for her own good, and therefore God does not accept her prayer. Nevertheless, her prayer benefits her, and its blessing will be revealed in one way or another.
Even the most righteous people, whose prayers were generally accepted, sometimes went unanswered. No one was greater than Moshe, whose prayerful intercession on Israel’s behalf after the sins of the Golden Calf and the Spies annulled decrees of destruction and gained forgiveness (Shemot 32 and Bamidbar 14). Yet when Moshe begged to be permitted to enter Eretz Yisrael, God said to him, “Enough! Do not talk to me further about this matter” (Devarim 3:26)
Therefore, one must make great efforts in prayer and not assume that since she is praying, God must grant her request. Rather, she should continue praying, knowing that God hears her prayers and that her prayers are most certainly beneficial, though we do not know how much, when, and in what way.