Let us discuss true sources of suffering. The fact that sufferings are not always produced but are produced in some places at some times and cease at some times and in some places indicates that they are caused. Logically, it can be said that sufferings are caused because of being produced occasionally. If sufferings were produced causelessly, either they would never exist or they would always exist.
Since sufferings are caused, one needs to look into what their causes are. In the Buddhist systems, the causes are explained to be contaminated actions and afflictive emotions....
For instance, if I had an angry feeling, this could serve as a motivating force that would lead to a harsh attitude, harsh speech, and harsh physical gestures. Since the anger that serves as the motivating factor is a defIlement--an afflictive emotion--the physical and verbal actions done through that motivating force are negative karmas, negative actions. Through them, the atmosphere immediately changes into one of tension. Right away, I might not feel the effects of those actions, perhaps even feeling that I had gained a victory over someone, even shouting, "I have won." However, later I will feel very sorry and shy, deep down experiencing a guilty conscience. Similarly, those around me would immediately lose their tranquility and peace. These are painful results of actions impelled by a bad motivation. This is the law of karma--motivation, action, result.
Conversely, a good, open, sincere motivation such as compassion with a deep respect for others impels verbal and physical actions that immediately create a peaceful, harmonious, enjoyable atmosphere. Due to that, I feel happy and calm, enjoying that atmosphere, and others around me also enjoy the same. Therefore, bad motivation creates problems, suffering, and pain, whereas good motivation creates happiness and peacefulness--something good.
This is the general explanation. On a deeper level, right at the time of an action, predisposing potencies are instilled in the consciousness. The performance of an action establishes a predisposing potency in the mind that, in the future, will serve as the causal condition for one's experiencing a good or bad effect.