Self righteousness. The Pharisee thought that he is good enough before God, and that he is better than the others, and that would be enough, to take his to heaven and attract God’s attention.
The tax collector thought that he is not good enough and he repented. The tax collector was concerned that perhaps, he was going to hell, because of his sins.
The pharisee thought that he did not need the grace of God, the tax collector was asking God for mercy. It shows that even if we do good things and live a righteous life, that is not enough before God to be saved, and go to heaven, but that we need Jesus. No matter how many good things we do, and if we try to keep the commands we still need Jesus for salvation.
It is impossible for us to be saved and go to heaven, regardless of if we keep all God’s commands, and live a holy life. That is because, no human being is able to keep the commands of God, all the time, 100 percent, during whole of their life on earth. And God knows that, that is why he sent Jesus to save us.