My understanding is that Karma is not a cosmic justice system, it is not punishment or reward for good or bad behavior. Karma an volitional/willful action, it is cause and effect pure and simple.
Here is a link to an article that will explain it much better than I could. https://www.thoughtco.com/buddhism-and-karma-449992