From my studying Buddhism, in that philosophy there are two types of karma, volitional (intentional) action, and the fruits of volitional action, which determine the destination and conditions of rebirth.
Volitional actions are enacted in thought, word, or deed. They can be light, dark, neither-light-nor-dark, or the kind of actions that lead to enlightenment and ultimately breaking free from samsara, the endless cycle of suffering that includes rebirth.
Rebirth is determined by the ripened fruits of the volitional actions in current and past lives. Karma determines what type of realm one is born into, and the conditions experienced in that realm. Earth is supposed to be a desirable realm but not as good as a heaven realm, and one can be born into good or bad conditions. Gautama Buddha identified conditions by past actions, for example that a physically ugly person acted in ugly ways in a past life. The way he identified such conditions, I can imagine a lot of people in Buddhist countries are vilified for purely genetic conditions because they are believed to deserve it, or that those who are poor deserve it because they were stingy in a past life, or those who die young deserve it because they previously took someone else's life.
In some ways, Gautama oversimplified it with the life conditions being explained as the fruits of past actions. In other ways, it is incomprehensible, and he says that it is difficult to understand or explain unless you achieve enlightenment yourself.
Not all of the concepts are unique to Buddhism. Gautama started out with Jainism and Bramahnism (and all of these religions have ties to Hinduism). He used their meditation techniques and struggled with parts of their philosophies, such as starvation and extreme physical punishment. Part of his enlightenment was his discovery of the Middle Way -- equanimity, not being too extreme in suffering nor indulgence. He said that each Buddha (not each person, but an actual Buddha) arrives at enlightenment -- how to be free from suffering and karma -- on his own, like finding a lost city that has always existed but was forgotten. This road to this city is the Eightfold Noble Path he re-discovered as an emerging Buddha, and which is followed by non-layperson Buddhists to achieve enlightenment, which can take innumerable lifetimes.
He also used the concept of karma to, imo, vilify his cousin, who was one of his monks, and tried to overthrow Gautama and have him killed when he didn't accept some of the rules for monks that his cousin wanted to add. The Nikayas (sp?) are stories of Gautama's past lives that he recalled in meditation just before his enlightenment. The cousin is often the bad guy in the story, providing a foil for Gautama to get closer to his goal of Buddhahood. The cousin always seemed to have these weird cursed-yet-blessed rebirths where his life purpose was to help further Gautama's goal. Imo, the cousin is one of the most scapegoated figures, if not the most scapegoated, in the history of the world.
(If you're interested, In the Buddha's Words is a good source for understanding the roots of Buddhism. I studied it deeply, and I came away with a good understanding of a lot of Buddhist concepts, as well as the personal opinion that Gautama was quite possibly narcissistic and had a big ego.)
Anyhow, Eastern religion became popularized in modern Western culture begining in the late 1800s with the charismatic and well-traveled Hindu Swami Vivekenanda, with Zen Buddhism in the Beat generation (and later Vipassana), and with the Hindu teachings of the Beatles' guru Maharishi Mahesh Yogi. Somehow along the way, Westerners got the idea that karma is about payback and justice, but neither the Buddhist nor Hindu cosmologies support this. It is complicated, nothing at all like the simple binary opposition found in the Western religious concepts of good/evil, God/Satan, and heaven/hell. In popular Western culture, karma became a similarly binary concept, but it is not an accurate representation of the concepts that originated in India.