If you've ever struggled with the meaning of karma, this article makes it clear from a buddhist perspective. "The Buddha’s focus on intention rather than actions and external circumstances allows us to fully acknowledge that the wicked can prosper, and that selfish behavior can bring a person great fortune and power. However, the mental state of such a person surrounded by luxury is a whole different matter. This also means that acting with compassionate intentions won’t magically prevent us from confronting the slings and arrows of life’s misfortune. But acting out of wholesome intentions opens up the possibility of becoming a person who encounters these challenges with less grumpiness and greater ease."