Karma means unintelligent action. Unintelligent action is action performed without benefit of complete knowledge. Intelligent action is another topic and includes Dharma and yajña. For every unintelligent action performed in a physical life, an ungrounded emotional or mental energy is created. This energy is the basis for a potential reaction that could arise in another physical life. If during the lifetime an unintelligent action (ungrounded energy) is not completely balanced and ceases to exist as a reverbrating energy in the S'rî Chakra of the person, then the ungrounded energy adds to the karma of a subsequent life.
Karma is managed by the Lords of Karma known as the Grahas. The Grahas create a prescription of karmas for a new life and this prescription is given over to the Âtman of the jiva for fulfillment. The karma prescription is created with the intention of providing the jiva with the life that it desires, but in a way in that will serve to protect the jiva from creating more misery for itself. The karma prescription is never created to "teach a lesson."
In every case, no matter what the circumstances of a person's life, that life is always much better than the person would have without the grace of the Grahas limiting the impact of the karma. No one could survive the misery he or she deserves based on a mechanical action/reaction play of karma. The weight of the debt of an individual's karma is so great that human life would not even be possible without the grace of the Grahas.
There is almost no jiva that deserves to be born in a human body. It is only through the grace of the Grahas that any jiva is granted such a life. It is only through the living of a physical life in a human body that a jiva can be saved from the otherwise never-ending cycles of birth and death. This is because in the human life, the jiva has freewill and may at any time decide to stop living an individual life.
The first mistake that every jiva makes is to decide to live an individual life. After making this fundamental mistake, known as pragyaparadh, the jiva spirals down into an ever-increasing matrix of karma from which it is powerless to extricate itself. It quickly loses its ability to inhabit a human body on the basis of karma, and only gains this supreme vantage occasionally by the grace of the Grahas.
When the Âtman creates a new human life, the karma for that life is coded into the DNA. Without changing the DNA, it is impossible for the individual to escape the fruits of that karma. This means that the entire life of an individual is predetermined at birth. One has freewill, but it can only be exercised within the confines of the karma generated existence. In some cases, the individual has enough intelligence from the latitude given in the prescription of karma to make the decision to stop living an individual life.
Jyotish is the science for knowing the karma of an individual life. It is given to us to provide some light on the path of our lives - jyotish literally means light. Through the study of a person's jyotish it is possible to predict the future course of events in that life. It would be cruel to provide this insight without some means of averting the danger that is to come. Hence along with jyotish is given the science of yajña. Yajña is the performance of a specific action that has been designed with total knowledge for the specific purpose of averting some karma. It is effective only when performed perfectly as prescribed and only when the particular yajña that is suitable for a particular karma is performed. Furthermore, the yajña must be performed before the karma has begun to arise - before the bullet leaves the gun. Once the karma has begun to sprout, yajña cannot stop it.
The book Âtmavedî, Part I has an entire chapter devoted to karma.