It is noteworthy that Rabbi Yochanan in the Gemora in Brochos (5a) derives from here that a person is considered fortunate if Hashem inflicts him. It is taught through a kal vachomer as follows: If the loss of a tooth or an eye, which is only one of the limbs in a person’s body, nevertheless, a slave gains his freedom because of it, then afflictions, which cleanse the person’s entire body, should certainly free a person from sin because of them!
Rish Lakish derives this same lesson from a different source. He says: The word covenant is written with respect to salt and the word covenant is written with respect to afflictions. Just as salt sweetens the meat, so too, afflictions will cleanse a person from his sins.
The Bobover Rebbe in Kedushas Tziyon notes that there is a distinction between the two expositions. According to Rabbi Yochanan, the afflictions will only cleans a person if they emanate from Heaven, similar to the halachos of a slave, where he will only be set free if his master knocks out his tooth or eye. He will not gain his freedom if someone else injures him. However, according to Rish Lakish, any type of afflictions will cleanse him, in the same manner as the salt sweetening the meat. It makes no difference as to who applies the salt.
Based upon this, Rav Tzvi Pesach Frank explains the following. It is written [Shmos 6:5]: And also, I heard the moans of the children of Israel, whom the Egyptians are holding in bondage, and I remembered My covenant. The Jewish people thought that the Egyptians were their masters and they were those who were afflicting them. They did not realize that their suffering was decreed from Heaven. Because they didn’t know who was causing them their hardships, they did not gain their freedom. It was only because Hashem remembered His covenant, that all afflictions cleanse a person from his sins, that was the reason they were released from the bondage.
Reb Meir Shapiro adds to this: If a slave does not come to court and testify that his master knocked out his tooth or eye, he will not gain his freedom. If he says that it happened by happenstance, he will not go free. So too, it is with afflictions. If a person does not believe with complete faith that the afflictions are affecting him because of Divine Providence, the afflictions will not purge him of his sins. However, if this principle was derived through the gezeirah shavah from salt, it would not make any difference.
The Rashba was asked the following question: If a slave initiates a fight with his master and strikes the first blow, and the master counters with some strikes of his own and knocks out the slave’s tooth, will the slave gain his freedom?
He replied that the slave goes free. The proof is from the aforementioned Gemora, where Rabbi Yochanan derived that afflictions will cleanse a person from his sins through a kal vachomer from the laws of the slave. How can the two be compared? Afflictions come to a person because he has sinned! It was his own fault! Perhaps, then, those afflictions will not purge him from his sins!? Evidently, we see that a slave also gains his freedom, even if he was the one who initiated the fight!