Jesus taught that prayer must be with expectation—expecting the best from God (from Matthew 7:7-11; Luke 11:8-13; Luke 18:6-8).
When you read these passages you will see that the emphasis of Jesus’ teaching on prayer is not entirely on the persistence of prayer, but I think it is more on the sure answers that God will give when we are persistent in prayer. Hence, when we pray, God does not want us to be so focused on our own persistence in prayer, but rather on how loving He is and how He wants to answer our prayers quickly. In both the Matthew passage and the Luke passage the emphasis is not so much on the asking but on the receiving, not on the seeking but on the finding; again, it is not on the knocking but on the door being opened.
The teaching Jesus uses in these three passages to emphasis this expectation in prayer is a teaching by contrast. In the Matthew passage the contrast is between earthly parents and our heavenly father. Here He is teaching that if our parents who are sinful naturally give us what is good when we ask them, God who is not sinful will much more give us good things when we ask Him.
In the Luke 11 story I think we also see a contrast between the friend who was asleep and our Heavenly Father who never sleeps. Here I think Jesus is telling us that if the man got up at midnight to give his friend bread because of his persistence, surely God, who doesn’t sleep and who always loves us, will gives us whatever we need if we ask Him. And we don’t need to ask with nearly as much persistence as that man did!
Then in the next story, in Luke 18, the contrast is with the unjust judge and God. Here the teaching is that if the judge gave the woman justice because of her persistence, God will certainly give us what we need when we are persistent. In verses 7-8 Jesus makes His teaching clear. He says that God will bring about justice for His chosen ones who cry out to Him “day and night.” Here I don’t think the emphasis is on praying “day and night”, but on the quick justice He will give. So the teaching here I think is that God will not keep putting us off when we pray, as the unjust judge did, but He will give us what we need “quickly.” By “quickly” I don’t think Jesus meant immediately, as if we don’t need to pray persistently, but I think it means “certainly” and that it will not take very long. Hence, God will not keep putting us off as the judge did, but He will give us what we need as quickly as we need it, or as quickly as it fits into His good plan for us.