The Point of Repeated Requests(Masechet Berachot Daf לב: Perek 5 Siman 79)
(condensed from Ein Ayah, Berachot 5:79)
Gemara: If a person sees that he prayed and was not answered, he should pray again, as the pasuk says: “Turn with hope to Hashem, strengthen and fortify your heart, and turn with hope to Hashem” (Tehillim 27:14).
Ein Ayah: The goal of prayer and thereby attaining one’s requests is primarily to actualize a certain level of shleimut (completeness), thus increasing one’s spiritual power in different manners. The ways a person’s grasp of the holy can increase are broad and can come in endless, detailed nuances.
Hashem, who created the world and knows all secrets knows what spiritual element is missing in each soul and correspondingly prepares for each person a means of self-improvement. This includes improvement by having one lack something for which he will have to pray. Sometimes it takes multiple prayers before the person develops the spiritual level he needs and so Hashem delays accepting his prayer so that he can work on the matter through additional prayer. Thus, one whose prayer was not answered should not give up hope but should continue praying. After all, Hashem can always bring salvation, and He plans to give a person the best prospects for the future.
It is human nature that when one makes efforts toward a certain goal and is not successful, his heart weakens. However, if he realizes that every step he takes brings him closer to the goal, just that many efforts are required, he will be strengthened and encouraged to continue working. Thus one should turn with hope, which is the shleimut itself and the goal of the efficacy of prayer in the first place. The more he turns to Hashem, the closer he becomes, which is the strengthening of the heart, and thus he should poise himself to continue.