As we have seen, the earliest writings of Hinduism were not overly-concerned with what happens after death. By the time of the Upanishads, however, three interrelated concepts had come to characterize the understanding of life and death: reincarnation, samsara, and karma.
Karma is the universal law of cause and effect: every human action plants a seed that sooner or later will grow into a positive or negative result, depending upon the intention of the individual when the action was committed. It is the simple rule that one reaps what one sows. In addition, the term "karma" is used not only to designate the universal law, but also to describe the results of one's actions. Thus, we often refer to good deeds producing "good karma" while bad deeds produce "bad karma."
An important point in the previous paragraph is contained in the phrase "sooner or later." It may take time for the results of karma to manifest themselves; in fact, it may take several lifetimes. A major doctrine of Hinduism is the belief in reincarnation. Reincarnation is the belief that after death, one's soul is reborn into a new body. The soul may be reincarnated into an individual of a different caste. What determines the status of one's rebirth is the law of karma. If one has "good karma" one may be reborn into a higher caste and better situation in life. On the other hand, negative karma may result in a birth of lower status. As you can see, the caste system thus reflects not only a divinely-ordered society; it also reflects the concept of karma. Consequently, it was reasoned that people of lower castes were born into their state because of negative karma they had accumulated in previous lives; people in the upper castes were reaping the benefits of good karma from previous lives.
It should also be noted that the doctrines of reincarnation and karma include the possibility of rebirth into a non-human form. Since only human beings can create good or bad karma, the non-human form could be considered to be a type of punishment that one had to endure to "burn off" negative karma. Eventually, one would be reborn as a human and have the opportunity to produce good karma so that subsequent rebirths might be better.
This ongoing cycle of birth-death-rebirth has no end and no beginning. In fact, the cosmos itself is thought to go through a series of deaths and rebirths. The ongoing cycle of life-death-rebirth is called samsara. Samsara literally means "swirling" or "wandering." It seems to refer to the state of the soul as it wanders from one life to the next.