Karma is a very important concept of Buddhism depending on what kind of karma that you build up as a result of whatever deeds you do. Your karma is the accumulation of your deeds in your current life. Your karma depends if you can escape the cycle of reincarnation or not. To obtain "nirvana" or the ultimate enlightenment, you must build up positive karma while making sure you do not build up any negative karma.
We are responsible for our karma which means we are responsible for our actions whether they are good or bad. In certain faiths such as Buddhism, getting enough good karma is essential to obtaining nirvana and breaking away from "samsara" which is the never-ending cycle of reincarnation. The amount of whatever karma you have built up determines if you can reach nirvana or not. If not, you will not be released from samsara.
You are born, you die, you are reborn, you die, and so forth. To understand that, you have to think of yourself as a robot with given objectives. You cannot be in peace until those objectives are carried out. Should you become damaged and/or destroyed, you’re taken to the scrap heap. Your body is rebuilt and your CPU is repaired. Then you’re sent to carry those objectives.
Think of the afterlife as that scrap yard and that robot as you for an example. Once you die, you’re brought into the afterlife. You continue that cycle until you achieved nirvana. Keep in mind that the amount of good and negative karma accumulated in this life will affect what you will be reborn as in the next life.
In Buddhism, it’s considered the cause and effect. Your action will be followed by an effect regardless if it’s good or bad. Keep in mind that we can have good intentions but a messed up mind can turn them into bad actions. Karma can be determined on not just what actions we take and how we take these actions.
In terms of karma, we have to be aware of what we do in this life. We have to think things through before doing an action. That’s how good or bad karma is built up in your life. Doing a good deed isn’t going to cancel out your bad deed. A bad deed will not cancel out a good deed. Don’t think you’re entitled to doing at least one bad deed because you’ve done a bunch of good deeds.
Karma is a boomerang effect: what comes around goes around.