The forces of cause and effect operate not only in response to behaviors, things we do or do not do, but also to the nature of our thoughts. If our thoughts are filled with love and compassion, then good things will come to us. If our minds are filled with anger, hate, or malice, then we will not have happiness and fulfillment, and spiritual retribution is sure to come.
You might like to see How Life Works: The Law of Cause and Effect. for a more general discussion of this topic.