Need encouragement to pray? John Calvin once said that “Nothing is better adapted to excite us to prayer than a full conviction that we shall be heard.” That’s why Jesus said things like:

Ask, and it will be given to you; seek, and you will find; knock, and it will be opened to you. For everyone who asks receives, and the one who seeks finds, and to the one who knocks it will be opened. (Matt. 7:7–8)

These unblushing promises are meant to encourage us to pray.

But they also raise an obvious question. How do we explain it when we’ve asked, but it sure doesn’t seem like we’ve received? We’ve sought, but we haven’t yet found. We’ve knocked, and the door is still shut. How do we explain unanswered prayers given Jesus’s claim that “everyone who asks receives”?

The Bible provides at least four possible answers.

1. Perhaps We Lack Faith

This isn’t always the reason. I repeat—this isn’t always the reason. But it’s at least a possible reason, since Scripture clearly says we should “ask in faith, with no doubting, for the one who doubts . . . must not suppose that he will receive anything from the Lord” (James 1:6–7).

So don’t just assume that you’re being faithless, but don’t dismiss the possibility out of hand, either. Do we doubt God’s power, goodness, or generosity? Do we doubt that we should ask for the thing we’re asking for? If so, we need to clear our head with a better vision of God and his will, so we can pray with greater assurance.

2. Perhaps We Need to Learn Persistence

In Luke 18, Jesus tells a parable about a persistent widow begging a judge for justice. The judge doesn’t really care about the widow’s plight, but she keeps asking, seeking, and knocking. So finally, he says, “Though I neither fear God nor respect man, yet because this widow keeps bothering me, I will give her justice, so that she will not beat me down by her continual coming’” (Luke 18:4–5).

The point is not that God doesn’t care, but if we pester him enough he might finally give in to get us off his back. The point is that if an unjust judge will act this way, how much more a just judge! This point is actually spelled out up front: “He told them a parable to the effect that they ought always to pray and not lose heart” (Luke 18:1).

In short, don’t give up! Keep asking, keep seeking, and keep knocking. Jesus doesn’t want us to be like someone who runs 500 feet and then pants breathlessly, unable go any further; he wants us to become marathon runners in prayer. George Mueller prayed for some people for 50 years before they finally became Christians, but he didn’t give up, and neither should we (cf. Luke 11:1–10).

3. Perhaps We’re Asking with Bad Motives

According to James 4, sometimes our prayers are simply adulterous. Instead of being faithful to God, we want to carry on a fling with the world while we keep God around to finance our trysts. But God isn’t about to be anyone’s sugar daddy. He is serious about loyalty: “he yearns jealously over the spirit he has made to dwell within us” (James 4:5), and he’s not interested in shelling out resources so we can “spend it on [our] passions” (James 4:3).

[Jesus] wants us to become marathon runners in prayer.

This reason for unanswered prayer is perhaps the most shocking. But this is only because the adulterous lure of the world doesn’t present itself as illicit, but as innocent. The gift we’re asking for may be good in and of itself (e.g., a car, a house, a wife), but we may want it too much, or for the wrong reason. Our desire for innocent things may have morphed into idolatry. And when that happens, answered prayer ceases to be a Father giving gifts and becomes a cuckold-enabling infidelity.

So if our prayers aren’t being answered, let us search our hearts and ask God to show us if there are any adulterous motives.

4. Perhaps We Need to Learn Trust

From the very beginning, Satan has pushed the idea of God as a miser who says no all the time because he doesn’t want us to be wise or happy or fulfilled. He ignores our prayers because he isn’t good and he doesn’t love us.

Jesus attacks this lie head-on in verses immediately following those unblushing promises in Matthew 7:9–11. Jesus basically asks, Do you have kids? OK. Do you love seeing the smile on their faces when you surprise them with a gift? Does it warm your heart when they ask you for something good, because they trust you and believe you’ll give it to them?

If you answered all these questions yes, it’s because you’re a good dad or mom. But here’s the rub: there is a Father in heaven who is infinitely better than you. Compared to him, you are evil (Matt. 7:11). As Matthew Henry put it:

“If all the compassions of all the tender fathers in the world were crowded into the [heart] of one, yet compared with the tender mercies of our God, they would be but as a candle to the sun, or a drop to the ocean.”

That’s why he loves to give good gifts to his children. Because he’s the good Father par excellence.

Good Fathers Don’t Always Say Yes

But that works both ways with answered prayers. Because as every parent knows from experience, sometimes your children actually do (unwittingly) ask for a serpent or a scorpion! And when they do, you say no—not because you don’t love your child, but because you do! It’s true that God withholds no good thing (Ps. 84:11), but it’s also true that not everything we ask for is truly good.

We should be thankful that God isn’t an unthinking vending machine that just spits out the drink based on whatever button we happen to push, because sometimes we accidentally push the wrong button. Haven’t we all done this? You meant to push Coke and accidentally hit Dr. Pepper, and the machine spits out Dr. Pepper—because it neither knows nor cares what you really wanted, it just knows what you pushed. Prayer isn’t like that. John Broadus once observed:

“It is . . . part of the privilege of prayer that God will withhold if he sees best. Were this not the case, the wisest and best persons might often be slowest to ask, for they know how often their judgment as to what was best has proved erroneous.”

If God were to automatically give you whatever you asked for, you’d eventually be afraid to ask. But he’s not, so you don’t have to be afraid.

It’s a privilege to pray to someone who is infinitely wiser than we are, who knows us better than we know ourselves, and who loves us more than any human father ever could.

You Can’t Lose

That’s why we can safely ask for anything that seems good according to his will—not only because we know he loves to give good gifts to his children, but because we can trust that even if he says no, it’s because he loves us and has something better. If not now in this vapor of a life, then in the unending age to come.

So don’t be discouraged by unanswered prayers. If God is your Father, then prayer is a no-lose scenario. Either your prayer is answered, or you have a chance to grow in faith, gain in persistence, purify your heart, or know your Father better. All things really do work together for good to those who love God—including the unanswered prayers.

Editors’ note: This article originally appeared at The Gospel Coalition.