As regards karman and its ethical value, Buddhist authors, especially of the earlier schools, had to distinguish themselves from Jaina opponents. Jainas embed a very ancient theory of karman, which understands karman as a sort of substance. Accordingly, a past good or bad action inhere in one's soul just like powder on a greasy item. In order to attain liberation, one has to free oneself from such a material substance, which envelops the soul and obstructs its power.
This leads to a major problem: how can karman, a substance, inhere in the soul, which is also a substance? The problem of the link between soul and karman was easily solved in the "Hindū" schools, since karman was thought to inhere in the soul as an action or a quality; and in the Buddhist ones, since karman was considered to be the only reality. What about Jainas? The usual way out is metaphorical: Jaina texts speak of karman as powder adhering to a wet cloth, or as water getting into a boat through its leaks. Later on, the notion of karman as a substance pervading the universe and attracted to the souls (called jīva, lit. ``living'') through their actions (meaning most of all "movements''), arises. According to Akalaṅka (8th c.), the karman would not adhere to the soul, if it were not for the soul's passions, which make it "greasy'' and fit for the karman to adhere on it. These passions, and their greasiness, is burnt through ascetism. In this way, the karman produced by the actions of a monk is immediately consumed.
Since karman is a material substance, it has a gross reality. In this sense, it is easy to understand how the performance of a bodily action is the more relevant ethical issue. Only a bodily action counts and consists of a substance. On the other hand, the intention while performing the action is no substance and has, hence, no direct ethical significance. Mental acts are, in fact, acknowledged among ethical factors, but only whenever there is no corresponding bodily action. A typical example of a mental act bearing negative ethical consequences is the adherence to a false doctrine (i.e., non adherence to Jainism). When a bodily action follows, the mental intention to perform it is not taken into account, either because it is overseen or because it is considered as just the precondition of the succeeding bodily action. Counter-examples, where intention and action performed do not harmonise (e.g., one kills someone although one did not want it to happen) are considered extreme exceptions. In fact, Jaina are extremely careful and mindful in avoiding every injury even to the minutest and subtlest living being. Once one knows about the existence of such creatures, a lack of attention is itself tantamount to the preliminary part of the action to kill them. For instance, not straining water means that one is deliberately swallowing the tiny living beings living in it. Hence, unconscious actions can be said to be evil, because they are caused by non-mindfullness.
In fact, the main way to accumulate this obstructive karman is –according to Jainism– to perform violence against other living beings. Consequently, non-violence is the supreme imperative for the Jainas. By refraining from committing any kind of violent act, conscious or unconscious, one does not accumulate further karman. Praying, studying, meditating, as mental activities are not karman and, hence, do not lead to any further accumulation of karman.
(I am not a Jaina expert. I hope Jaina readers will bear with me).