Some people ask, if everything Hashem does is good, and Hashem is so kind and merciful, then why doesn’t He just show us how this is so? Why does He make things happen that seem bad, instead of just showing us how they are good?
The answer is that sometimes Hashem indeed does show us how seemingly negative events are truly for the best, but in other instances, as the Lev Simchah explains, He makes the situation look bad to give us the opportunity to trust in Him and thereby accrue the great benefits of this mitzvah. Trusting Hashem elevates a person to great spiritual heights and brings blessing and salvation, and Hashem therefore makes events appear difficult in order for us to earn these benefits.
The Gemara (Berachot 60b) tells of Rabbi Akiva who was traveling and wanted to spend the night in a certain town, but nobody agreed to host him. He was forced to sleep in the forest, and soon a lion came and ate his donkey, a cat ate his rooster, and a gust of wind blew out his candle. Throughout this ordeal, Rabbi Akiva reminded himself that everything Hashem does is for the best. The next morning, he saw that the town had been ransacked and all the residents were killed. If the attackers would have seen his light or heard his animals, he, too, would have been killed.
In a shmuz, Rabbi Chaim A. Yamnick raised the question of why Hashem had to resort to such measures to save Rabbi Akiva’s life. Certainly, He could have come up with some other way of ensuring that the attackers would not see him. Why did Rabbi Akiva’s animals have to perish and his candle blow out?
The rabbi answered that Rabbi Akiva earned this miraculous salvation by trusting Hashem when the situation looked bleak. It was specifically by insisting that everything was good when it looked bad that Rabbi Akiva earned the merit he needed. Trusting Hashem and believing that everything is good when it looks bad is what earns us great blessing and salvation, and this was how Rabbi Akiva’s life was spared