The central scene of this impressive play is Act IV scene 1, which is of course the famous trial scene. The most pertinent speech in this entire scene, however, is Portia's reflection on the nature of mercy and justice. Let us remind ourselves of what is said in this speech that captures these twin themes so brilliantly:
The quality of mercy is not strained.
It droppeth as the gentle rain from heaven
Upon the place beneath. It is twice blest:
It blesseth him that gives and him that takes.
'Tis mightiest in the mightiest; it becomes
The throned monarch better than his crown.
His scepter shows the force of temporal power,
The attribute to awe and majesty,
Wherein doth sit the dread and fear of kings.
But mercy is above this sceptered sway;
It is enthroned in the hearts of kings...
Note how this speech shows us what is at issue. Shylock as the right in law to his pound of flesh. He insists on justice and the law. Ironically, Portia, in her disguise, insists on upholding every letter of the law, knowing that in the law lies the loophole that will allow Antonio to be safe. Yet she still tries to encourage Shylock to show mercy.
However, what is clear in this scene is that Shylock's concern is not for justice and for the law, but for revenge. He is happy to use justice and the law as vehicles to achieve his revenge, but they are not important to him. Therefore, perhaps we can argue that his punishment is fitting because of the way he uses and manipulates important concepts such as justice. He receives justice because of the way that he abuses it, and the irony of Portia applying the law fully in his case is not lost on both him and others. Having just refused to show the slightest bit of mercy in the case of Antonio, he can hardly expect mercy to be shown towards him. Yet, having said this, many productions focus on the punishment of Shylock as being too harsh, and suggest that there is a double standard in Portia's eloquent plea for mercy and then her own inability to show mercy to Shylock. Either way, justice and mercy is one of the central themes of this play.