This question can be best answered by breaking it into two questions: 1) Does prayer change God’s mind? and 2) Does prayer change things? The answer to the first is, no, God does not change His mind. The answer to the second is, yes, prayer changes things. So how can prayer change circumstances without changing God’s mind?
First of all, in order for God to change His mind, He would have to improve upon Himself in some way. In other words, if God changed His mind, that action would suggest that His first way of thinking was deficient, but, because we prayed, He improved His plan concerning our situation. We change our minds when we see a better way to do something. We thought A but realized B was better, so we change our mind. But, since God knows all things, the beginning from the end (Revelation 22:13; Ephesians 1:4), it is not possible for Him to improve upon any plan that He has made. His plans are already perfect (2 Samuel 22:31), and He has stated that His plans will prevail (Isaiah 46:9–11).
What about passages like Exodus 32:14 that seem to imply that God “repented of” His action? The Hebrew word nacham, often translated “repent” or “change one’s mind,” can also mean “sorrow” or “to bring comfort.” Genesis 6:6 is the first occurrence of this word in reference to the Lord: “The LORD regretted that he had made human beings on the earth, and his heart was deeply troubled.” This appears to mean that God had second thoughts about His decision to create human beings. But, since God’s ways are perfect, we need to look for an alternate understanding. If we apply the secondary definitions of the word translated “regretted,” we can understand this verse to mean that the wickedness of man brought great sorrow to God’s heart, especially in light of what He must do to restore them.