What lessons should we derive from the story Of Moses and the wise man (supposed to be Khidr) in Surah Kahaf?
The referred incident is God's way of teaching His prophet - Moses (sws) - some realities and requirements of faith in the Merciful, Wise, Omniscient and Omnipotent Creator. The incident has been mentioned in the Qur'an to teach the same lesson to the believers in the Prophet (sws).
The referred incident teaches us that we - humans - cannot, generally, understand the wisdom of the happenings before us. Our failure to comprehend the wisdom, mercy and providence behind these happenings can easily lead us to think that some of the divine decisions are unjust.
We see that most of us get depressed and lose heart and as a consequence abandon perseverance on the right path, which is often difficult to tread for it seems that evil people are favored and the pious and the good are denied in this world.
Killing an infant and damaging a boat owned by orphans apparently seem cruel until we are told that they were actually intended to save some pious people of graver troubles. Similar is the case of the mending of the wall for people who had behaved cruelly to Moses (sws) and the wise man. It was actually for the benefit of someone else that the wall was mended.
Just as these acts turn out to be the most benevolent and merciful acts when the wisdom working behind them is revealed, all the affairs in this universe would actually reveal profound wisdom and abundant mercy of the Almighty. It is only our lack of knowledge that we interpret some acts to be against our benefit. We should believe in the profound wisdom of God and trust in His love and mercy for us, even if the circumstances around us are extremely unfavorable. We must always remind ourselves that affairs of the world are run by the Just and the Merciful, even if at present we cannot fully understand the aspects of justice and mercy in most of the happenings around us.