Karma, as defined by the "ultimate source of all knowledge", is a way to encourage good behavior in people. It is the belief that if you do something that, eventually, you will get rewarded for that action. Good for good and bad for bad. This is vaguely similar to the christian point of view of eternal reward or damnation. I am not attempting to confuse karma with Christian point of view, they are not the same thing.
I take a much more simplistic view of how this works. It depends on two things. First, our own conscience. We know, sense innately when we have done something wrong. By repeatedly doing something wrong we loose that sense, if we are honest within ourselves that is never truly lost completely. This sense creates in us a kind of memory. We know and typically remember very well those things we have done wrong. In the same manner, we know and remember when we have done something good. Second, this is not a perfect world and stuff happens. We have the ability to choose and we do not always make good choices. Our choices, however much we like to think otherwise, do not affect only ourselves but also those around us. Thus when someone makes a choice that effects us in a negative way we recall all of our bad choices and think, "What goes around comes around. I deserved that." With similar thoughts regarding things that happen to other people. It is not a self fulfilling prophecy but rather our own minds which make the connections.