It is what appears to be punishment at the time, but was actually designed by God to help the person.
NYer's experience is a perfect example. At the time, you're asking, "Why is this happening to me? What did I do to deserve this awful thing?" Only later do you find out why.
I was asking because (d) called it medicinal punishment.