Parshat כי תצא has more laws in it than any other Parsha with more than seventy of the 613 Mitzvot. Throughout the Torah, there is a concept of סמיכות הפרשיות, where we try to see the connection and reason as to why one subject follows another. This is seen very openly in כי תצא at the beginning of the Parsha. We are first taught about the woman taken captive in battle. The Torah frowned about taking such a woman for lustful purposes. This subject is followed by a man having two wives; one he loves and one he hates. The connection here is that the hated wife is likely to be the one he took in battle. This is followed by the case of the בן סורר ומורה, the totally rebellious son. He is likely to be the product of the union of the hated wife. He will be a thirteen year old that is impossible to handle. The fourth subject is that the cursed of G-d shall not be left hanging on the gallows overnight. The "cursed of G-d" could likely be the rebellious son that is put to death at the age of thirteen because of the more serious crimes he will commit as an adult. So we see why the Torah chose to place these particular subjects one after the other. This is סמיכות הפרשיות.