"Also He spoke this parable to some who trusted in themselves that they were righteous and despised others: 'Two men went up to the Temple to pray, one a pharisee and the other a tax collector. The pharisee stood and prayed thus with himself, 'God, I thank You that I am not like other men - extortioners, unjust, adulterers, or even as this tax collector. I fast twice a week; I give tithes of all that I possess.' And the tax collector, standing afar off, would not so much as raise his eyes to heaven, but beat his breast, saying, 'God, be merciful to me a sinner!' I tell you, this man went down to his house justified rather than the other; for everyone who exalts himself will be humbled and he who humbles himself will be exalted."
The Lord had been teaching His disciples about prayer in the first eight verses of Luke 18. In the parable of the persistent widow, He taught of a helpless person with nothing but right on her side. She desired justice and her persistent prayers to God and pressure against the unrighteous judge, brought about justice in the end. The Lord encouraged His people to be bold, confident and persistent in their prayers.