The term for prosecution is prosecution, regardless of the offense(s) that prompted the proceedings. Based on the pair of examples you sketched, you might be referring to involuntary manslaughter.
Black's Law Dictionary defines manslaughter as "[t]he unlawful killing of another without malice, either express or implied; which may be either voluntarily, upon a sudden heat, or involuntarily, but in the commission of some unlawful act". This unpublished opinion reflects an example of variant of this definition under California law (see references to section 192).
Both of the examples you outline involve an unlawful act: putting the nail against the tire of a car, pulling a knife on a victim, and maybe the passerby's act of shooting.
There is no all-encompassing term for all other acts which trigger series of events not involving the death of a person. This would depend on the tort or violation and the mental state attributed to it: involuntary, [grossly] negligent, reckless, intentional, malicious, and so forth.
kills a bystander, and the knife thief is the one charged with murder.
That will not be necessarily the case. The prosecutor's task is to assess the circumstances and preliminary evidence in order to decide who to charge and for what.