To answer your question you need to return to Act IV scene 1 of this great play. This is the famous court scene, where Antonio is taken before the Duke to hear the case that Shylock has against him and Portia, dressed as the young learned lawyer, seeks to defend him from Shylock's completion of the debt that he so foolishly made. Portia shows herself to be incredibly skillful in the wording of the law, as it is her discovery of the loophole in the bond that Shylock is so determined to hold on to that effectively allows Antonio to escape his punishment. Note what she says that saves him:
Tarry a little; there is something else.
This bond doth give thee here no jot of blood;
The words expressly are "a pound of flesh."
Then take thy bond, take thou thy pound of flesh;
But in the cutting it if thou dost shed
One drop of Christian blood, thy lands and goods
Are by the laws of Venice confiscate
Unto the state of Venice.
With these words, it is Portia, disguised as the lawyer, who saves Antonio from having a pound of his flesh removed from his body by Shylock, who is intent on vengeance.
Dressed as a lawyer, she reviews the contract that Shylock designed for Antonio. While it is true that he can command a pound of flesh from Antonio, Portia explains that he did not agree on any amount of blood. Since that means--to Portia, at least-- he cannot have any of Antonio's blood, he cannot realistically remove any part of Antonio's flesh.
The credit of saving Antonio from the evil plans of Shylock, the Jew goes to Portia. She dresses as a lawyer asks Shylock to take the twice the money which is been borrowed by Antonio. This famous speech is presented in the form of a poem in many of the literary books under the title Quality of Mercy . But Shylock stubborn with his evil plans desires to have a pound of flesh from Antonio's breast.In order to teach a lesson to treacherous Shylock she asks Shylock to have his bond, to cut of the flesh from Antonio's body without drooping even a drop of blood. Realising danger Shylock leaves Antonio free. Some critiques are of the opinion that this act of Portia is an injustice done to Shylock but the fact is that Shylock gets back his reward in the same coin as he used against Antonio