The thing is, in practice no one actually treats prayer this way. People treat prayer like they're the old lady harassing the magistrate that Jesus talks about in Luke 18. Like God is some lazy bureaucrat that they're trying to nag into giving them what they want. Or they have his mother's ear (how many times have you heard that analogy?) and she'll make him do what you want for you.
Or, even more commonly, prayer is treated as a kind of magic that works to transform you or somehow invokes divine power on the things in your life. I've seen innumerable examples of this in popular piety. "I have X problem." "PRAY THIS NOVENA!"
But when you run up against the reality that the novena/rosary/chaplet/etc. you prayed didn't do anything, you're told that prayer isn't magic, that God works in mysterious ways, and that you just need to trust more. And if you push hard enough you'll end up back at the Thomistic account of prayer I gave in the first paragraph above. (Or worse, with some mumbo jumbo along the lines of "Prayer doesn't change God, it changes us.")
It's just kind of crazy, because on one hand you hear everyone saying to say all these prayers because "they work", but on the other hand when you push you get told "prayer isn't magic", i.e. it doesn't actually do anything. And you'll hear the both things from the same people, priests, etc.
Truly I tell you, if you have faith as small as a mustard seed, you can say to this mountain, 'Move from here to there,' and it will move. Nothing will be impossible for you.
and likewise over
Ask, and it will be given to you; seek, and you will find; knock, and the door will be opened to you. For everyone who asks receives; he who seeks finds; and to him who knocks, the door will be opened.
and similar verses:
Again, I tell you truly that if two of you on the earth agree about anything you ask for, it will be done for you by My Father in heaven.
If you believe, you will receive whatever you ask in prayer.
And I will do whatever you ask in My name, so that the Father may be glorified in the Son.
And I appointed you to go and bear fruit--fruit that will remain--so that whatever you ask the Father in My name, He will give you.
Now if any of you lacks wisdom, he should ask God, who gives generously to all without finding fault, and it will be given to him.
and we will receive from Him whatever we ask, because we keep His commandments and do what is pleasing in His sight.
These promises are made so many times throughout the new testament. As a kid I was really confused by them, because they all seem to be promising very literal responses to requests in prayer. And to my knowledge no one has ever said "move" to a mountain and had it move. Which I guess means that no one has ever had any faith? Naturally once you start theologizing about this, it gets reconciled into "oh well he's speaking metaphorically" and "God answers prayers in accord with his providence" and "the Lord works in mysterious ways".
But Jesus when making all these promises about answers to prayer doesn't talk about mysterious ways, and it all seems quite literal. In fact the number of times these promises are made, and the number of variations on the promise seem to suggest that they really are meant literally. But after reconciling all of these passages with the platonic idea of God as an immutable form, and with the experience (easily verified) that they are not literally true, we end up with a restatement of the Catholic position on prayer that runs more or less thus: If you pray, sometimes, providentially, your prayer may be in accord with God's will. In these cases it will be answered. However, no one can know when or whether that will happen, except that the very desire to pray is itself be a manifestation of providence, whether or not it bears any fruit.
But Jesus when making all these promises about answers to prayer doesn't talk about mysterious ways, and it all seems quite literal. In fact the number of times these promises are made, and the number of variations on the promise seem to suggest that they really are meant literally. But after reconciling all of these passages with the platonic idea of God as an immutable form, and with the experience (easily verified) that they are not literally true, we end up with a restatement of the Catholic position on prayer that runs more or less thus: If you pray, sometimes, providentially, your prayer may be in accord with God's will. In these cases it will be answered. However, no one can know when or whether that will happen, except that the very desire to pray is itself be a manifestation of providence, whether or not it bears any fruit.
In this case, it's hard to say why it's worthwhile to bother praying for anything at all—the only prayer worth bothering about is simply "thy will be done", and this primarily as an exercise in spiritual submission. And yet in practice, pastorally and in popular piety, there is no question at all that petitionary prayer is treated as something that matters, works, and corresponds to some sort of divine promise to hear and answer us. After all, Jesus said so.
Which is it?