Luke begins this parable with Jesus’ definition of the Pharisee: “confident of their own righteousness and looked down on everyone else.” He doesn’t say all Pharisees fit this description, but it seems this is the typical Pharisee, one that everyone listening to the parable would relate to.
The Pharisee draws attention to himself with audacious, condescending words: “God, I thank you that I am not like other people…or even like this tax collector.” He then justifies himself by announcing he fasts twice a week and gives a tenth of his income.
On the other hand, the tax collector humbly presents himself to God and asks for mercy.
For all those who exalt themselves will be humbled, and those who humble themselves will be exalted.
It is good to do good, but no there is nothing I can do to earn salvation–salvation only comes by grace.