At the start of The Merchant of Venice Shylock is a successful money lender with a thriving business on the Rialto. He is wealthy, with a good house and daughter. He is clearly identified as a Jew whom the Christians judge harshly, in particular Antonio who cannot do enough to defame and denigrate Shylock.
At the end of the play, Shylock is a broken man. His desire for vengeance, no matter how justifiable, collapsed around him. The court rightly found against him for threatening the life of a citizen (a pound of flesh was always an absurdly extreme condition, which Antonio foolishly and arrogantly agreed to). His daughter has renounced him and their religion. She has stolen his wealth and his keepsakes. His means of livelihood are taken from him by the court as part of his judgement and he is forced, as was often the case, to become a Christian.
The lessons pointed out by Shylock's changes are several. Two of them are: (1) He was wrong to ignore God's injunction against taking vengence. (2) Even if Antonio was an arrogant fool, he was wrong to require a contract that might take his life.