We all heard the story of Pinnochio. Every time he lied his nose would grow longer. Imagine this were true for all human beings. How many would make sure they always tell the truth? Most likely all of us. Now imagine our nose would also grow longer every time we sinned. How many would constantly critique our actions, making sure that what ever we do, we do not sin? Again most likely all of us.
So question, why didn't Allah manifest the consequence of sin as it seems this is the only means by which all of us will collectively seek to be virtuous beings.
A moments reflection will reveal that if every virtuous deed was manifestly rewarded immediately and if every evil deed was manifestly punished immediately, then both patience and faith will no longer have a need. Why?
Well that is because patience and faith are inseparably intertwined, i.e. one will not be able to wait for things to improve if one does not have faith. Yet if one does not need to exercise patience, one does not need to have faith. So if every good deed is rewarded immediately patience would not be needed and so in turn faith would also no longer be needed.
Now consider this, if patience and faith are no longer necessary, than how will the virtuous and the corrupt ever be separated? The reason the corrupt engage in sin is because they have no patience. They want immediate gain which is why they lie, cheat and steal. Yet they would not need to do this if every good deed was rewarded immediately. So we can see here that at any value a virtuous deed is now completely gone for even the wicked would engage in virtuous deeds.
So Allah has placed a veil. That veil is none other than this world, which is merely a shadow of our real existence, the hereafter. Thus it is this shadow that conceals the manifest consequences of good and evil and so it is here where the true believers are separated from the evil doers.
Now we should be aware that every action, every word, every thought, is motivated by our virtues and vices. None can dispute this. For instance, it may be our sincerity that drives us to a certain action, or perhaps our ego, whatever the motivation may be, it will be from either the two warring parties, virtue or vice. This is the mother of all wars. A war in which its aftermath will be manifested at our death, revealing the condition of our soul and thus, the side we ultimately chose. A heavenly warrior of virtue beaming of light, or a hellish indescribable creature of vice, doomed to darkness.
Could this be why many scholars are reported to have highly emphasized to repeat the following prayer and sincerely ask for their end result to be brilliant and felicitous:
Allahummaj'al awaaqiba umoorina khayran (O Allah make the final consequences of our affairs to be good).