James 4:2 reads:
ἐπιθυμεῖτε, καὶ οὐκ ἔχετε· φονεύετε καὶ ζηλοῦτε, καὶ οὐ δύνασθε ἐπιτυχεῖν· μάχεσθε καὶ πολεμεῖτε. οὐκ ἔχετε διὰ τὸ μὴ αἰτεῖσθαι ὑμᾶς· (W-H)
Using this scriptural verse as his starting point, John Sanders (The God Who Risks) asks whether God may sometimes refuse to act in the life of a Christian unless the said Christian prays (with a proper motive) for O (a variable which stands for things requested by means of prayer). Additionally, Sanders wonders whether God ever does something he otherwise would not do because a Christian or a "believing soul" (to use Merold Westphal's terminology) prays for God to do O.
While it is certainly possible (from a logical standpoint), as adherents of predestination contend, that God could have foreordained both our prayers and the effects that would follow therefrom, the Bible itself seems to suggest that prayer can emanate spontaneously from a heart filled with devotion for God. Prayer, according to Scripture, also appears to be capable of effecting what otherwise would not be effected. In the OT, God is even said to feel regret and abstain from doing something He originally purposed to do when one of His servants offers a heartfelt prayer.
For instance, while Hezekiah was on his deathbed, he fervently prayed to Jehovah (with good motive) and his life was extended by 15 years in order that he would have time to produce a seed for the throne of David (2 Kings 20:1-6). James 5:16 also tells us that a righteous man's supplication, when it is at work, "has much force" (POLU ISXUEI). The context of that passage also suggests that God may sometimes abstain from effecting X or Y until one of his servants petitions or supplicates Him for X or Y. Such prayers are called impetratory prayers.
Eleonore Stump has written an interesting paper exploring what difference petitioning God makes. In that study, she asks a very interesting question. Can God make humans freely do anything? I too ask whether God foreordains humans to "freely" petition or supplicate Him for X or Y? Does it make sense to talk about an agent foreordaining someone to freely do anything? To me, it seems that men and women are able to pray freely (in a somewhat libertarian sense) without being foreordained to do so. When they consequently pray sincerely or altruistically in harmony with God's will, it is possible that the prayers of Christians may bring it about that God does something He otherwise would not have done. Yes, the supplication of the righteous man, when it is at work "has much force."