The law of Karma (Sanskrit: कर्म), or Kamma (Pali) originated in the Vedic system of religion, otherwise known as Hinduism. As a term, it can at the latest be traced back to the early Upanishads, around 1500 BCE.
In its major conception, karma is the physical, mental and supramental system of neutral rebound, "cause and effect," that is inherent in existence within the bounds of time, space, and causation. Essentially what this means is that the very being which one experiences on (say, as a human being) is governed by an immutable preservation of energy, vibe, and action. It is comparable to the Golden Rule but denies the ostenisble arbitrariness of Fate, Destiny, Kismet, or other such Western conceptions by attributing absolute reason and determinism to the workings of the cosmos.
Karma, for these reasons, naturally implies reincarnation (though the opposite is not true) since thoughts and deeds in past lives will affect one's current situation. Thus, humanity (through a sort of collective karma) and individuals alike are responsible for the tragedies and good 'fortunes' which they experience. The concept of an inscrutable "God" figure is not necessary with the idea of karma. It is vital to note that karma is not an instrument of a god, or a single God, but is rather the physical and spiritual 'physics' of being. As gravity governs the motions of heavenly bodies and objects on the surface of the earth, karma governs the motions and happenings of life, both inanimate and animate, unconscious and conscious, in the cosmic realm.
Thus, what certain philosophical viewpoints may term "destiny" or "fate" is in actuality, according to believers of karma, the simple and neutral working out of karma. Many have likened karma to a moral banking system, a credit and debit of good and bad. However, this view falls short of the idea that any sort of action (action being a root meaning of 'karma'), whether we term it 'good' or 'bad', binds us in recurring cause and effect. In order to attain supreme consciousness, to escape the cycle of life, death, and rebirth and the knot of karma one must altogether transcend karma. This method of transcendence is variously dealt with in many streams of not only Hinduism and Buddhism, but other faiths and philosophical systems as well.
From Hinduism the concept of karma was absorbed and developed in different manners in other movements within the other Indian subcontinental (South Asian) religions of Buddhism, Jainism, and Sikhism. Although these religions express significant disagreement regarding the particularities of "karma", all four groups have relatively similar notions of what karma is.
More recently the concept has been adopted (with various degrees of accuracy and understanding) by many New Age movements, Theosophy and Kardecist Spiritualism.
Hinduism sees karma as immutable law with involuntary and voluntary acts being part of a more intricate system of cause and effect that is often not comprehensible to one bound by karma. It is the goal of the Hindu, as expressed succinctly in the Bhagavad Gita, to embrace a 'sattvic' lifestyle and thus avoid creating more karma (karma is not qualified as good or bad). By ceasing to create more karma, the jiva-atma or individual soul is able to move closer to moksha, or liberation.
To the Hindu, karma is the law of the phenomenal cosmos that is part and parcel of living within the dimensions of time and space. All actions, thoughts, vibrations of any sort, are governed by a law that demands perfect rebound. So all jiva-atmas (individual souls) must experience karma if they live and experience the phenomenal universe. To escape the cycle of life, death and rebirth, one must exhaust one's karma and realize one's true Self as the highest truth of Oneness that is Brahman (or for dvaitists(dualists) bliss with the Supreme Godhead).
Karma does allow for anirudh (Divine Grace). Through exceeding devotion and love of God, the Hindu believes one can be helped to speed through Karma phal (Karmic fruit). By developing 'vairagya' or 'detachment' from the fruits of one's karma, as Lord Krishna most famously summarized, one can transcend karma and be liberated. One is aided by love of God. All the Yogas of Hinduism seek to transcend karma through different means of realization.
In Buddhism, only intentional actions are karmic "acts of will". Often misunderstood in the West as "cause and effect", in actuality, Karma literally means "action" - often indicating intent or cause. Accompanying this usually is a separate tenet called Vipaka, meaning result or effect. The re-action or effect can itself also influence an action, and in this way, the chain of causation continues ad infinitum.
When Buddhists talk about karma, they are normally referring to karma that is 'tainted' with ignorance - karma that continues to ensure that the being remains in the everlasting cycle of samsara.
This samsaric karma comes in two 'flavours' - good karma, which leads to high rebirth (as a deva, asura, or human), and bad karma which leads to low rebirth (as a hell-sufferer, as a preta, or as an animal).
There is also a completely different type of karma that is neither good nor bad, but liberating. This karma allows for the individual to break the endless cycle of rebirth, and thereby leave samsara permanently.
This seems to imply that one does not need to act in a good manner! But the Buddhist sutras explain that in order to generate liberating karma, we must first develop incredibly powerful concentration. This concentration is akin to the states of mind required to be reborn in the Deva realm, and in itself depends upon a very deep training in ethical self-discipline.
This differentiation between good karma and liberating karma has been used by some scholars to argue that the development of Tantra depended upon Buddhist ideas and philosophies.
Understanding the universal law of Karma provides order to a beginningless and endless universe. Alongside this view is the related notion of Buddhist rebirth - sometimes understood to be the same thing as reincarnation - which has its roots in the principle of Karma.
Most teachings say that for common mortals, having an involvement with Karma is an unavoidable part of day-to-day living. However, in light of the Hindu philosophical school of Vedanta, as well as Gautama Buddha's teachings, one is advised to either avoid, control or become mindful of the effects of desires and aversions as a way to moderate or change one's karma (or, more accurately, one's karmic results).
The idea of karma was popularized in the west through the work of the Theosophical Society. Kardecist and Western New Age reinterpretations of karma frequently cast it as a sort of luck which is associated with virtue: if one does good or spiritually valuable acts, one deserves and can expect good luck; contrariwise, if one does harmful things, one can expect bad luck or unfortunate happenings. In this conception, karma is affiliated with the Neopaganlaw of return or Threefold Law, the idea that the beneficial or harmful effects one has on the world will return to oneself.