Knowing virtuous karma is, like dreams, intrinsically illusory. If we can contemplate in this way, even if anger arises, it cannot destroy the root of virtue.
If you would like to know more about karma, you can read the fourth chapter of the Abhidharma-kosha-shastra, which clearly explains the workings of cause and effect.
The doctrine of the Twelve Nidanas is a key Buddhist thought. It mainly delineates how the past, present and future lives of human beings or other viviparous animals of the desire realm2 come about. In other words, it explains how we enter and leave this world.