The phrase "the quality of mercy is not strain'd" is spoken in Act IV of William Shakespeare's The Merchant of Venice, and it is spoken by Portia (in disguise as Antonio's lawyer) in a courtroom. Two things are in play during this speech: one is the legal elements of Shylock's case against Antonio and the other is this plea for mercy, a distinctly Christian concept. In part, mercy is "love of one's friends, compassion for those in difficulty and a willingness to forgive past wrongs...."
Portia has Antonio freely admit his liability to Shylock, the penalty for which is a pound of Antonio's flesh. Instead of pursuing the legal points of her case first, Portia changes direction and speaks to Shylock:
Portia: Do you confess the bond?
Antonio: I do.
Portia: Then must the Jew be merciful.
Shylock: On what compulsion must I? tell me that.
Portia: 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.
Portia's demand for mercy assumes a Christian morality, something Shylock, a Jew, does not share. When he asks why he "must" show mercy, Portia tells him that mercy cannot be forced ("strain'd") because it demonstrates grace instead of demanding the fulfillment of the law. Even more, mercy blesses both the one who gets it and the one who gives it, raising the status of the giver to God-like. Her reference to God's judgment is a veiled threat that God will judge Shylock for not being merciful, something God will offer, as well, but only to Christians. It is a not-so-veiled statement that Shylock's fate as a Jew is eternal damnation.
As delivered, then, this request for mercy is really more like an ultimatum than an appeal, for she is about to use Shylock's own commitment to the law against him--unless he demonstrates mercy (undeserved compassion and release from punishment). He does not.
While Portia is the one who makes the appeal for mercy and then shows absolutely no mercy by using a technicality of the law to save Antonio's life, she is not the one who determines Shylock's sentence. The Duke of Venice actually does show mercy to Shylock by saving his life, though in exchange he takes away every reason Shylock has to live as well as his livelihood. He could have taken Shylock's life but he spared it, though perhaps Shylock would argue that he would be better off dead.
What happens to Shylock, by definition, is both just and merciful. It is just because the laws of the land were fairly interpreted in his case. Shylock had a chance to change his fate by showing mercy but refuses, so now he is subject to the laws of the land, which is justice. The law says Shylock's life can be taken, and the Duke shows mercy (forgiveness of a debt) by sparing it. Antonio also displays mercy by giving Shylock the opportunity to keep some of his assets if he will convert to Christianity; though he is forced to renounce his religious heritage, he was nonetheless shown mercy.
While it may not seem like it, Shylock does receive mercy (grace which is freely given) both by the Duke and by Antonio because Shylock keeps his life. Portia might have shown it, too, if he had accepted her appeal. Clearly all of them could have shown more mercy.
For an insightful examination of the religious atmosphere of Shakespeare's England and a discussion of Shylock's forced conversion to Christianity as a merciful act, see the eNotes "Theme" link, below.