Prayer is not mere obedience. The very word "prayer" has to do with requests being made. When we take our anxieties before the Living God we are beseeching the ruler of all to make a change in what might beset us, (the actual, intended future of the various forces and wills involved) if we had not prayed. We are asking for His mercy.
Philippians 4:6 Have no anxiety about anything, but in everything by prayer and supplication with thanksgiving let your requests be made known to God.
The anxiety that the chaos of life contributes is given to God for His remedy and our faith is in His willingness to answer the prayers of the righteous.
James 5:16 The prayer of a righteous man has great power in its effects.
The assumption in the James passage (and it argues that Elijah's prayer was powerful to effect the weather and that he was just like us) is that prayer effects, causes, prompts Our God, not merely participating in what He was already effectually doing. It is the prayer that has great power. By it, Moses turned God's wrath over the disobedient Israelites to mercy. By prayer, Hezekiah turned aside God's decree of his immediate death (by the word of Isaiah the prophet) to add fifteen more years of life.
II Kings 20:1-6 In those days Hezeki'ah became sick and was at the point of death. And Isaiah the prophet the son of Amoz came to him, and said to him, "Thus says the LORD, `Set your house in order; for you shall die, you shall not recover.'" Then Hezeki'ah turned his face to the wall, and prayed to the LORD, saying, "Remember now, O LORD, I beseech thee, how I have walked before thee in faithfulness and with a whole heart, and have done what is good in thy sight." And Hezeki'ah wept bitterly. And before Isaiah had gone out of the middle court, the word of the LORD came to him: "Turn back, and say to Hezeki'ah the prince of my people, Thus says the LORD, the God of David your father: I have heard your prayer, I have seen your tears; behold, I will heal you; on the third day you shall go up to the house of the LORD. And I will add fifteen years to your life. I will deliver you and this city out of the hand of the king of Assyria, and I will defend this city for my own sake and for my servant David's sake."
And the prayers of the citizens of Nineveh turned God away from the promised destruction in forty days because Our God is "a gracious God and merciful, slow to anger, and abounding in steadfast love, and repentest of evil. " Jonah 4:2
God will do what He wills but it is His will to respond to our prayer.
Psalm 34:15 The eyes of the LORD are toward the righteous, and his ears toward their cry. Peter quotes this as well (I Peter 3:12) to give us hope in difficult times.
An ignorance of God's responsive mercy sometimes keeps us from praying with faith. Even C.S. Lewis struggles with the question (without coming up with an answer) in his essay "The Problem of Petitionary Prayer". It is basically framed up in our minds as, "If God knows what I need before I ask Him, why then do I pray?" That which is accomplished by our prayers is granting God the knowledge, not of my needs, but of my faith in His willingness to respond. The "faith" in His mercy without this "work" is dead. There can be no response without the stimulus. There can be no answer from God without our question. He knows with certainty that we don't believe in His mercies when we don't petition Him. He can't respond without our cry because response had to hear something. The actuality of wanting Him to move comes into existence when our prayers bring before Him our wants and desires. He is happy to move heaven and earth for the prayer of faith. It is then that we have what the rest of the Philippians 4 passage promises; "And the peace of God, which passes all understanding, will keep your hearts and your minds in Christ Jesus."
And all God's children said "Amen!"