When God created the earth and heaven, He did not need any help. But when God created man, He intended man to be a prayer partner. In a sense, God waits for man to pray before He acts. In creation God acted alone, in the Bible age, God works with man. So in the example prayer of Elijah, God waited for Elijah to pray. Elijah prayed what God wanted to pray, then prayed to God and God answered from heaven with rain. Without the prayer of Eljah, no rain was coming.
So in every situation God is waiting for us to pray before He acts. The phrase below “prayed with prayer” indicates that Elijah prayed the prayer that God gave him to pray. What a cooperation between God and man to fulfill His purpose on the earth..
James 5:17-18 Elijah was a man of like passions to us, and he prayed with prayer that it should not rain; and it did not rain upon the earth three years and six months; 18 and again he prayed, and the heaven gave rain, and the earth caused its fruit to spring forth.
Then in the Lord’s prayer, Jesus also teaches us to pray “Thy will be done on earth as it is in heaven”. So God wants us to pray for His will to happen on the earth. His will does not happen automatically, it needs prayer to bring it to earth