One cause, different effects
My grandfather explains that for a person, a task will differ according to what's needed. Accordingly, he would do good with one hand and inflict punishment with another. In contrast, for G-d it is possible to do a single action that serves as both reward and punishment. The differentiation is solely in the recipient.
That is the concept , he say, that Chazal bring up (Nedarim 8b) "In the future Hakadosh Baruch Hu will bring out the sun unfiltered, and the righteous will be healed from it while the wicked will be sentenced by it." It's through the same sun that some will be healted and others punished. Even though the sun's role is to do good for humanity, when a person is sick, its rays can harm him. Likewise, the good of Hakadosh Baruch Hu causes pain to the wicked, and that's their punishment.
The footnote on this piece cites, "Mipi Elyon lo tetzeh haraot vehatov" There is no bad and good from Above. The flow of good doesn't change in its source but its effect will depend on the recipient. Consequently, the same force will prove beneficial for the righteous and devastating for the wicked.
Related post: http://kallahmagazine.blogspot.com/2015/10/dvar-yehudah-parsha-points-from-my.html