Whether Anyone ls Punished for Another's Sin

Q87, Article 8: Is anyone punished for someone else’s sin?
www3.nd.edu/~afreddos/summa-translation/Part%201-2/st1-2-ques87.pdf

I don’t understand what St Thomas says about this.

On the other hand, if we are speaking about the sort of punishment that has the character of medicine, then it is possible for one individual to be punished for the sin of another.

This quote is on the very bottom of the second to last page of the document. From this quote onwards, I don’t understand it.

Can someone please explain this in simple layman’s terms? Maybe it would become obvious to me given an example. Thanks

We read in a letter from Gemma to her confessor Monsignor Volpi, dated November 1899 that one evening her aunt had charged into her room in a fury, shouting that since little Giulia was not around as a shield, now was the time to end all this nonsense about her “bleeding stigmata”. “Maybe a beating shall do the trick” the aunt screamed, as she grabbed Gemma by the neck in a choke hold and began to rip away her dress so she might see the wounds for herself. Surely by the grace of God her other aunt providentially arrived, ended this threat, but only momentarily. Later, as Gemma was about to fall asleep, the angry aunt returned, fulminating that she “was not as easily deceived as Monsignor Volpi” and insisting that Gemma tell her where the bleeding came from and why it came.

Amidst her uncontrollable crying, Gemma answered that her brother’s blasphemy was the cause. “What! Blasphemy causes you to start bleeding?” “Yes,” Gemma responded, “I see how much Jesus suffers from blasphemy, and I suffer with Him, and my heart suffers, and then blood comes out.”
The aunt regained enough calm to continue her interrogation: “Is it only your brother’s blasphemies that cause you to bleed, or is it everyone’s?” and Gemma replied “Everyone’s, but with a big difference–his make me suffer much more! In saying this, I wept bitterly, and she left me”

The next morning the somewhat humbled aunt asked only that Gemma “keep the incident quiet, and that she could stay with Cecilia Giannini if she wished, just that she come home on Sundays."

stgemmagalgani.com/2010/02/humble-shall-be-exalted-st-gemma-is.html

Another example is Élisabeth Leseur. Her husband was an atheist who tried to break her faith. She became ill and suffered badly for some number of years before dying. When she was dying, she told her husband that she asked God to allow her to suffer for his conversion. He told her would remain a committed atheist. After she died, he read her secret diary about the sufferings she endured for him. He was converted and became a priest.

There was an interesting talk by Archbishop Fulton Sheen about that, and about asking God for suffering to convert souls. He had asked God for suffering to save a soul. A woman who was an atheist decided to follow him one day, leaving her tour, while vacationing in Europe. The atheists who were on vacation that day died in a bus accident. He stayed with her until she finally converted, then he had sufferings.

Saints have described suffering for souls in purgatory as well.

Kind David was punished for his sin thru the death of his baby as explained by the prophet.
This was intended to wake him up.

DISCLAIMER: The views and opinions expressed in these forums do not necessarily reflect those of Catholic Answers. For official apologetics resources please visit www.catholic.com.