A fortuneless nobleman, Bassanio, asks for a loan from the merchant Antonio so that he can pursue Portia, a wealthy heiress, in order to restore his fortune. Since the merchant has all his assets tied up with ships that at sea, he tells Bassanio he will use his credit to obtain a loan from the Jew Shylock. Because Shylock fiercely hates Antonio, he latches on to the opportunity to get revenge; he agrees to loan Antonio the money. But, if Antonio does not repay this loan, Shylock will get a pound of flesh as payment from him.
With the money he needs, Bassanio pursues Portia, and he selects the casket (small box) that allows him to marry her. But, in the meantime, Shylock's daughter runs off with a Christian, converts, and steals her late mothers jewels. The avaricious and offended Shylock is enraged by this; he vows to exact the flesh from Antonio, who is unable to pay the loan because his ships are lost at sea. When Portia learns from Bassanio of Antonio's plight, she disguises herself as a doctor of law and, with her servant Nerissa dressed as a law clerk, Portia appears at court on Antonio's behalf where Shylock demands of the Duke,
I have possessed your grace of what I purpose
And by our holy Sabbath have I sworn
To have the due and forfeit of my bond" (4.1.34-36).
Portia's speech before the court is clearly a statement of theme for this drama:
The quality of mercy is not strain'd;
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. (4.1.186-192)
While it seems that Portia goes along with the sentencing, when Shylock takes steps to cut off his pound of flesh, Portia/the doctor of law points out that there was no provision in the conditions for Antonio's blood, so Shylock can only have flesh--no blood. Defeated, Shylock is further humiliated as he is made to convert to Christianity. Antonio's ships finally arrive and the lovers, Bassanio and Portia, are married.