What do we learn from "Tzadik Hashem b'Chol Devarav"?
Radak: He gives to everyone his food b'Tzedek and with straightness. Even though living beings tear and eat others, e.g. cats, lions and birds eat mice, animals and birds respectively, all is Tzedek, for also the victims received their food in their lifetimes. However, when it was time for it to die, He decreed beforehand that sometimes others will benefit from its death. 1
Malbim: Even though there is Tzadik v'Ra Lo and Rasha v'Tov Lo, everything is just. He pays to a Tzadik for a small sin and to a Rasha for a small merit in this world, so the Tzadik's reward and the Rasha's punishment are guarded [intact] for the world to come.
Radak: Some say that it is a punishment for a sheep to be torn via a lion. It says about a seagull swallowing fish "Mishpatecha Tehom Rabah" (36:7; Chulin 63a). Some say that reward and punishment are only for man. I say that they are rewarded and punished for their actions to man - "mi'Yad Kol Chayah Edreshenu" (Bereishis 9:5); "v'Lo Shavar Es ha'Chamor" (Melachim I, 13:28). Bechorah applies to donkeys, for they carried Yisrael's booty (Bechoros 5b). We cast Tereifos to dogs, (Shemos 22:30), for they did not did not bark at Makas Bechoros (ibid., 11:7); Hashem does not deny the reward of any creation (Mechilta Mishpatim 195).
How is Hashem a Chasid in all His deeds?
Radak: He gives what He is not obligated to give, and they do not deserve to receive, just His Chesed overpowers.
Malbim: Everything that He did and created in His world was due to Chesed - "Amarti Olam Chesed Yibaneh" (89:3). Every creation is made in the best way, due to Chesed.