How Karma Actually Works

Many of us are familiar with the word karma, but do we understand how it works?

Traditionally, karma in the East is seen as action and consequence(s) of the action. You perform an action that produces the consequence, and that consequence is then karma. This karma sets a stage for the following situation, where you take action in the following situation, create new karma that sets the stage for the following situation, and so forth on the wheel of rebirth, the Sea of Samsara, the treadmill of human existence.

Karma is often seen as punishment for the wrong deeds done in this lifetime or previous lifetimes. But, of course, there is 'good' karma as well. Therefore, people do charity work as they believe that we will have good karma by being a good person. But, if that is all, why is there still so much suffering in this world? Why