Consider the story of Rabbi Meizlish of Cracow and Warsaw, who was a well-to-do merchant before he became a rabbi.
Even then, when he was sending timber along the river to Germany to be sold there at a profit, he was famous for his erudition, and he used to teach brilliant pupils at the yeshivah.
Once the news came that the timber rafts were wrecked in a storm, and the whole of the rabbi's fortune was lost in one day.
They did not know how to tell the rabbi and chose one of his favorite pupils to do so.
The young man selected a passage in the Talmud and came to the Rabbi with his question:
"It says here that one has to thank God with blessings for the evil that befalls one as well as for the good. How can this be done?"
The rabbi explained the matter in terms of its hidden meaning as well as in straightforward theology.
To this the pupil replied, "I am not sure I understand. And if my rabbi were to learn that all his timber rafts were wrecked on the river, would he dance for joy?"
The rabbi said, ''Yes, of course."
"Well then," said the pupil, "you can dance–all the rafts are lost!"
Upon hearing this, the rabbi fainted.
When he came to, he said, "Now I must confess I no longer understand this Talmud passage."
In other words, there is a difference between theoretically knowing that God is always present and knowing it when one is crushed.
To be sure, there are many saints, and even ordinary men, who are able to bless the evil as well as the good, not only to receive it without complaint, but also to accept it with joy.
The capacity to do so is a function of deeper comprehension as well as of faith or certainty in the wisdom of the hidden workings of God.
Hence we understand the meaning of the verse: "Happy is the man whom Thou, a God, chasteneth…” (Psalms 94:12).
–Rabbi Adin Steinsaltz
From The Long Shorter Way by Rabbi Adin Steinsaltz