Antonio borrows money from Shylock using his own flesh as collateral so that Bassanio can woo Portia, who is stuck at her estate waiting for her true love to propose.
Once Bassanio has won Portia's hand in marriage, they get word that Shylock is going to be able to claim Antonio's flesh. Portia poses as a lawyer and declares that Shylock's claim is valid in the Venetian court.
The claim is valid, all right, but Shylock is not permitted to spill Antonio's blood, Portia says. She then charges a baffled Shylock with conspiring to kill Antonio. The new couple now seems set to live happily ever after.