" Human nature inclines us to have recourse to petition for the purpose of obtaining from another, especially from a person of higher rank, what we hope to receive from him. So prayer is recommended to men, that by it they may obtain from God what they hope to secure from Him. But the reason why prayer is necessary for obtaining something from a man is not the same as the reason for its necessity when there is question of obtaining a favor from God. Prayer is addressed to man, first, to lay bare the desire and the need of the petitioner, and secondly, to incline the mind of him to whom the prayer is addressed to grant the petition. These purposes have no place in the prayer that is sent up to God. When we pray we do not intend to manifest our needs or desires to God, for He knows all things. The Psalmist says to God: "Lord, all my desire is before Thee" and in the Gospel we are told: "Your Father knoweth that you have need of all these things." Again, the will of God is not influenced by human words to will what He had previously not willed. For, as we read in Numbers 23:19, "God is not a man, that He should lie, nor as the son of man, that He should be changed"; nor is God moved to repentance, as we are assured in 1 Kings 15:29. Prayer, then, for obtaining something from God, is necessary for man on account of the very one who prays, that he may reflect on his shortcomings and may turn his mind to desiring fervently and piously what he hopes to gain by his petition. In this way he is rendered fit to receive the favor. "
― Thomas Aquinas , Aquinas's Shorter Summa: Saint Thomas's Own Concise Version of His Summa Theologica