“תַּאֲוַת עֲנָוִים שָׁמַעְתָּ ה'; תָּכִין לִבָּם, תַּקְשִׁיב אָזְנֶךָ. (תהלים י:י"ז)
“God, You have heard the request of the lowly. You prepare their heart; may Your ear be attentive.” (Ps. 10:17)
The psalm speaks of God hearing the prayer of the downtrodden. Yet the expression “You prepare their heart” is peculiar. Is it not the supplicant who collects his thoughts and directs his mind before beginning to pray? Why does the verse appear to assign the task of preparing the heart — to God?
The Sages taught (Berachot 31), “One who prays should direct his heart to heaven.” They based the requirement for directing the heart on this phrase, “You prepare their heart.” Again, it is not clear: who exactly is preparing the heart and mind?
There are in fact two types of kavanah (intention or focus) in prayer. The first type is when we pay attention to the meaning of the words and overall ideas of our prayers. This is the basic and primary level of kavanah.
A more advanced kavanah is when we are able to sense God’s infinite presence. The Talmudic advice to “direct one’s heart to heaven” refers to this higher kavanah. We should contemplate upwards to the heavens, elevating our thoughts to reflect on the sublimity of God’s Name.
This is how the Sages interpreted the verse: You — consciousness of You and Your boundless grandeur — “will prepare their heart” — will serve to direct their hearts and minds.
This explanation helps explain the conclusion of the verse. Meditating on God’s Name uplifts the soul, thus achieving the goal of prayer. Such a successful prayer is more likely to be accepted. You — by focusing on Your Name — “will prepare their heart,” and as a result, “Your ear will be attentive” to answer their prayers.
(adapted from Ein Eyah vol. I p. 131)