Three figures pray and God delights in it: Moses, David, and the Messiah. This is the claim Aggadat Bereshit makes from (Proverbs 15:8) — "the prayer of the upright is His delight." The wicked bring their sacrifices, the whole burnt offerings, the correct ritual — and it is an abomination. The righteous speak from the gut, and God leans in to hear.
Moses's prayer is called "a prayer of Moses, the man of God" (Psalm 90:1) — a title that belongs to no other figure in the Psalms. His prayer comes from a lifetime of arguing with God, pleading for a stiff-necked people, begging for entry into the land he was denied. It is the prayer of someone who has lost everything and still speaks. David's prayer comes from the other direction — a king who has everything and still needs God's vindication: "Hear, O Lord, my righteous plea; listen to my cry" (Psalm 17:1). The Messiah's prayer is different still — "a prayer of the poor man, when he is faint" (Psalm 102:1). Not a king, not a prophet. A poor man at the end of his strength.
The rabbis are building a portrait of what divine delight actually responds to. Not ritual perfection. Not high station. Not doctrinal correctness. Prayer that comes from someone who knows exactly how much they need what they're asking for — that is what moves the heavens. God hears three prayers. Each one from a different kind of righteous person. Each one a delight.
Chapter 6, Writings. [1] A prayer of David: Hear, O LORD, my righteous plea (Psalms 17:1). In the scriptures it is said: "The sacrifice of the wicked is an abomination to the LORD, but the prayer of the upright is His delight" (Proverbs 15:8) refers to Moses, David, and the Messiah. Regarding Moses, it is written, "A prayer of Moses, the man of God" (Psalms 90:1). Regarding David, it is written, "A prayer of David" (Psalms 17:1). Concerning the Messiah, it is written, "A prayer of the poor man, when he is faint" (Psalms 102:1). "And the prayer of the upright is His delight" (Prov. 15:8), although all three pray, David prays with artistry. How can one say, "Hear, O LORD, my righteous plea"? The Holy One, blessed be He, said, "Until when will you pray? Say what you need, for you said, 'my righteous plea.' I swear by your life that for the sake of one of the things that I have mentioned before you, My vindication will come from You; (Psalms 17:2). Why did you say, 'If the leader sins' (Leviticus 4:22)? "A leader over whom there is no ruler except for God, since over a ruler there is no judge except for You, my judgment comes before You. David was a great artist, when he asked something from the Holy One, blessed be He, he played music to Him, as if to say, he delved his thoughts like those skilled in the wisdom of the microcosm (Baba Kamma 103b, Baba Batra 61a*). Deep wells of understanding." He asked first about the easy things, and only afterwards about the difficult things. Why was David similar to a person who asked to borrow a wheat barrel from the lender, and the lender said to him, "Please lend me a carob barrel because I am in a difficult situation"? David replied, "Come and take, we will take (the barrels) together." The lender then asked David to lend him a barley barrel and leave a carob barrel instead. David replied, "Come and take, we will take (the barrels) together." The lender then asked David to make him a wheat barrel and lend him carob and barley under it. David replied, "Take it, but who caused him to first ask about the easy things and only then about the difficult things?" The answer is from the verse "Judgment fell for David, 'The Lord has heard my righteousness.'" (Psalms 7:9) That is, first the easy things, and then the difficult things came before him in a straight path, as it is written "Your eyes will see what is straight before you." (Isaiah 30:21) God replied to him, "And I will act, for it is written, 'Behold, I will plead your cause and take vengeance for you' (Jeremiah 51:36), and 'I will contend with him that contends with you' (Isaiah 49:25)." End of story. [*comment: This statement is found in the Talmud Bavli tractate Bava Batra 93b, and it discusses the power of a Jewish leader or "nasi" who has no earthly ruler above him, only God. The passage states that since there is no one to judge or govern the Nasi except for God, then his judgment must be considered just and valid. It then goes on to praise King David as a great artist, as he would deepen his thoughts and connect with God when playing music. The phrase "והואיל שאין על גבי מושל אלא ה'" can be translated as "since there is no ruler above him except for God," emphasizing the unique position of a Nasi who is accountable only to God. The phrase "מלפניך משפטי יצא" means "my judgment comes from You," implying that since God is the only authority over the nasi, his decisions are divinely inspired. The passage then shifts to discussing King David and his artistic talents. The phrase "אומן גדול הי' דוד" means "David was a great artist," and the following phrase "כשהי' מבקש דבר מן הב"ה מנגנו" means "when he would seek something from God, he would play music." The term "אינגיניו בלע"ז" refers to David's musical instruments, and the phrase "כמו הנהו נגאני דארעא מיקרו" means "he would play so deeply that the ground would shake." This passage highlights David's unique talents and spiritual connection with God.]