One can sin and subsequently forget; or sin without realizing it; or have a host of sins, some major and some minor. As such, when one is punished in the afterlife, it may not be immediately clear why. Of course, Allah could just explain why.
Question: If we are punished in the afterlife, will we know why?
Perhaps our sins and their respective punishments will be itemized on the Day of Judgement. Along these lines is:
Then on the Day of Resurrection he will be brought to account for every major and minor action, even though he has already been brought to account for that in the grave. -- Islam Q&A
This indicates that we will be aware to some degree (or maybe we're just accounting for major and minor actions, but without knowledge of how each is contributing to the quality of our afterlife).
I'm not sure where I could begin searching for an answer to this question, Googling the title of this question (link) doesn't give relevant hits.