(Exodus 21:22) introduces the case of men who fight and accidentally injure a pregnant bystander. The Mekhilta asks why this passage is necessary. From (Exodus 21:14) — "And if a man be bent against his neighbor to kill him" — we already know that intentional killing is a capital crime. What does this new section add?
The existing law covers the straightforward case: a man intends to kill his enemy and succeeds. He is put to death. But what about a man who intends to kill his enemy and instead kills an innocent bystander? That scenario is not addressed by the earlier verse.
The fighting-men passage fills this gap. "And if men fight, and they hit a pregnant woman, and her fetuses miscarry, and if there be death — then you shall give a life for a life." The "death" here is the death of the bystander woman. The men were fighting each other, not targeting her. Yet if she dies as a result of their brawl, the striker is held to the standard of "a life for a life."
This establishes the principle of transferred intent. You cannot escape liability for killing an innocent person simply because you were aiming at someone else. The Torah holds you responsible for the actual consequences of your violence, not just your intended consequences. The section about fighting men and the pregnant bystander closes what would otherwise be a dangerous loophole in the law of homicide.