united-states
For a particular sovereign in the United States, the criminal law test for this is from Blockburger v. United States (emphasis mine)
12
Each of the offenses created requires proof of a different element. The applicable rule is that, where the same act or transaction constitutes a violation of two distinct statutory provisions, the test to be applied to determine whether there are two offenses or only one is whether each provision requires proof of an additional fact which the other does not. Gavieres v. United States, 220 U. S. 338, 342, 31 S. Ct. 421, 55 L. Ed. 489, and authorities cited. In that case this court quoted from and adopted the language of the Supreme Court of Massachusetts in Morey v. Commonwealth, 108 Mass. 433: 'A single act may be an offense against two statutes; and if each statute requires proof of an additional fact which the other does not, an acquittal or conviction under either statute does not exempt the defendant from prosecution and punishment under the other.' Compare Albrecht v. United States, 273 U. S. 1, 11, 12, 47 S. Ct. 250, 71 L. Ed. 505, and cases there cited. Applying the test, we must conclude that here, although both sections were violated by the one sale, two offenses were committed.
What this says in more plain language is that a person can be prosecuted under two different statutes for the same logical act as long as there is at least one fact that has to be proven for each count which doesn't have to be proven for the other count. This does mean, for example, that a person could not be prosecuted for aggravated assault, acquitted and then later prosecuted for simple assault on the same facts if there aren't any facts required for simple assault that aren't required for aggravated assault.
For the example in the question, this does seem to mean that if, for example, a robber was first prosecuted for murder, and then later separately prosecuted for carjacking after the murder, this would not be double jeopardy. I would guess in practice that courts wouldn't appreciate this kind of game-playing since it wastes the court's time as well to adjudicate two trials when there could just be one, but I don't know if there's a hard rule against it. Blockburger was actually arguing that multiple convictions from one trial should be overturned because some of them relied on the same facts as another. In this case SCOTUS ruled against Blockburger, but on the basis that the facts did not overlap, not that the legal basis of the argument was unsound.
I noted in the beginning that this applies to particular sovereigns, which in terms of US law means either a state or the US Federal Government. Under the dual sovereignty doctrine (e.g. Gamble v United States), if the same set of facts of a case constitute both a state crime and a federal crime, or the also likely case that a federal crime requires all the facts of a state crime plus a few more, both the relevant state government and the Federal government can prosecute the person under their own statutes. This would technically also apply if two states wanted to prosecute someone, although it's unlikely that there is any way to have the exact same set of facts break two different state's laws since state laws generally can only cover actions taken inside the state or affecting that state in particular.