Why is the law about an unsolved murder placed between laws on warfare? Killing in war is not a sin, but it still brings a collective blood guilt that must be purged.
The heifer killed for an unsolved murder is not a sacrifice or atonement, as all sacrifices must be offered at the altar in Jerusalem. There's no altar here of any kind. Moses doesn't give us a clear explanation of what is going on in Deuteronomy 21:1-9. Is the heifer beheaded or neck broken? There's a lot of disagreement about that among Jewish & Christian commentators. I see good arguments both ways.