If It Is God's Will It Will Happen Anyway
There is an idea that we pray because it is God's will that we pray and if God wills for it to happen then the prayer will be answered. If he doesn't will for it to happen then it doesn't. This idea is in conflict with scripture.
If any of you lack wisdom, let him ask of God, that gives to all men liberally, and upbraids not; and it will be given him. (James 1:5)
According to scripture, James and Proverbs for example, it is God's will that people have wisdom. God instructs people who lack it to ask him for it and promises to give it to them. This is a pretty clear statement of his will. Yet, the next two verses in James tells us that not every one who asks will receive it.
But let him ask in faith, nothing wavering. For he that wavers is like a wave of the sea driven with the wind and tossed. For let not that man think that he will receive any thing of the Lord. (James 1:6-7)
So, even though it is God's will for a person to have wisdom, if their prayer for it is not according to faith, they will not receive it. In fact, the person who doesn't pray in faith will not receive any thing they ask for, whether it is God's will for them to receive it or not.
There are a number of important lessons for perfecting prayer here.
Just because we pray for something that is God's will doesn't mean we will receive it.
Just because we don't receive something doesn't mean that it isn't God's will for us to receive it.
Faith is required to produce results in prayer
Doubt prevents us from receiving answers to prayer - even when it it God's will that we receive
Prayer is governed by spiritual law. Faith is required for prayer to work. Doubt works against prayer and causes it to fail.