In this chapter, we are given a ritual of atonement for unsolved murder and various laws governing family relationships.
The first part, ritual atonement of unsolved murder, is relatively straightforward. We know that only blood can atone for spilt blood, and since the murderer cannot be found in this case, it seems that an animal sacrifice is the next option. Unlike the tabernacle sacrifices, this one requires that the animal's neck be broken, which means that while it kills the animal, no blood is shed into the ground. Probably the reason for this is that the animal is slain away from the tabernacle and we know that the Israelites are not to "sacrifice in the open fields" (Lev 17:5). I think breaking the animal's neck is meant as a compromise between the requirement that the animal be slain near where the murder took place, but also to not be a "sacrifice" as prohibited by Lev 17.
The second part is a law on the treatment of captive women who are taken by the Israelites as wives. This law has two requirements: that the woman leave behind everything from her old life, signified by cutting her hair and nails, removing old clothing and mourning her family. After that, she begins a new life as an Israelite's wife, and the Israelite is prohibited from mistreating her, though he is permitted to divorce her.
As with the prior chapter, Deut 20, I think this passage is subject to frequent misinterpretation for the simple reason that people try to evaluate it based on modern cultural suppositions. This is a point that I've had to drive home again and again because it shows up so much in popular discourse, to the point that many well-meaning Christians will even disavow the OT entirely, just because they cannot construct a consistent interpretation between the OT and the NT (this is called a harmonization). How do we reconcile passages like this with the "love your enemy" of Jesus?
The most important part is understanding the cultural context. This is a society that largely operates with arranged marriages, so the first thing to understand is that most women have little to no choice in whom they marry (we saw this with Isaac marrying Rebekah and Jacob marrying Leah and Rachel). So the Israelites picking out women to marry from amongst the captives is little different.
However, slave women would have far less societal protection from abuses, and that's exactly what this law addresses. The husband maintains the right of divorce, which he also possesses when married to Israelite women. Another big difference is that slave women are almost certain to worship other gods, which is partly why there is such an emphasis on cutting ties to her old life. Marrying an Israelite means both a new husband and a new religion, and the woman will be expected to give up everything from her old life.
This is another instance of progressive revelation, where the LORD gives a revelation that is culturally relevant to the people receiving it, even if that revelation does not fully encapsulate the truth, just as we today do not have the full truth, but the LORD interacts with us in ways that we can understand for our good.
Next is a provision that men cannot favor children from the wife they love over the children of the wife they hate. I think this law is interesting because it shows us the kinds of tensions that can form when a man marries multiple women, how it engenders conflict between those women and the man's obligations to both. We saw this in Genesis when Jacob loved Rachel and did not love Leah, and how desperate Leah was to bear children so that Jacob would love her. Rachel, in turn, suffered from infertility and was also desperate to have children.
Here we are told that men cannot give the double portion to the son of their loved wife over their true firstborn from the unloved wife. Ironically, this is precisely what Jacob did as he gave the double portion to Joseph, son of Rachel.
The fourth command in this chapter is that rebellious sons can be put to death by their parents' testimony. This is basically just an extension of the 5th commandment (honor your father and mother), so I don't really have anything to add.
Lastly, we are told that a man executed for committing any crime and who is "hanged on a tree" must be removed and buried the same day he is killed. It's hard to say exactly what is the impetus for this command, but I know that in Israelite culture, prompt burial is considered important. Later in the bible we will see people get punished by dying outside "in view of the sun, moon and stars". I think partially it goes back to the idea of covering, that being uncovered exposes that person to the judgment of these celestial bodies (who are perhaps metaphors for God and the angels). For instance, Noah was shamed by being uncovered, and his sons honored him by covering him (Gen 9).
I think "covering" a person's body through burial is probably analogous and is a sign of respect, just as Noah's two sons respected him by covering the nakedness of his drunkenness.
In addition, we know that dead bodies are a source of ceremonial impurity, so prompt burials is also a means of limiting ceremonial impurity for bystanders and the people who live in that area. Lastly, rotting bodies are a source of bacterial contamination in groundwater, so there is also a public health aspect to burials.
Reviewing this chapter, it appears that the first part clearly relates to the 6th commandment, that the Israelites not murder. The next two commands relate to marriage (and perhaps the 7th commandment, to avoid adultery), then a command for children to obey their parents (5th commandment), then lastly a commandment regarding the bodies of men executed for crimes (6th commandment?). So the author doesn't seem to be following a clear progression that I can see.
Deut 22 is also a bit confusing as it contains a section of various commands that don't clearly relate to a specific commandment. This chapter is, however, the end of the 6th commandment section.