The efficacy of prayer does not consist in giving God new knowledge or inducing him to change his intentions. Rather, it consists in creating conditions under which God can appropriately give gifts that he eternally wills to give, provided that the necessary conditions have been met. The change brought about by prayer is not a change in God, but in the created world.
--St. Thomas Aquinas