And a mediator must stand between justice and mercy to determine what is fair. The perfect Mediator, Jesus Christ, knows our peculiar circumstances, and most importantly our hearts. (Alma 18:32.) He knows the difference between someone who openly seeks sin and someone who, in a moment of weakness, succombs to temptation. He also discerns between the penitent sinner who, through sincere repentance, is willing to submit to God's commandments and the recalcitrant dissembler who says he is sorry when he has no intention of changing his ways. Thus, Jesus' judgement of us will be perfectly fair.
And if we seek to be fair, we must emulate Jesus as best as we can. We may not be able to see into the hearts of our fellow beings, but we can consider their circumstances to temper justice with mercy.One last thing, let us not be bitter when we see mercy extended to others for we will all need mercy sooner or later.
For an excellent parable and discussion of the principles of mercy and justice, see Boyd K. Packer, The Mediator.