We know that we can act and that our actions produce results. Everyone who believes in God must therefore admit (quite apart from the question of prayer) that God has not chosen to write the whole of history with His own hand. Most of the events that go on in the universe are indeed out of our control, but not all. It is like a play in which the scene and the general outline of the story is fixed by the author, but certain minor details are left for the actors to improvise.
It may be a mystery why He should have allowed us to cause real events at all; but it is no odder that He should allow us to cause them by praying than by any other method.
C.S. Lewis, “Work and Prayer,” God in the Dock (Eerdmans: 1970) 105-106.