“their firstborn children.” The Hebrew uses the idiom, “all that opens the womb,” referring to the firstborn children.
“that I might make them desolate in order that they would know.” The point God is making is that the sin of the people in burning their firstborn children would result in their destruction as a consequence and show the people that Yahweh was God. People cannot sin against God without consequence.