The LORD uses Hosea the prophet to be a picture of what God is to Israel and Judah.
God tells Hosea to marry a harlot. She has children by him, and then returns to her whoredoms. Hosea then buys her back after she is used and abused.
This is how God was to his people Israel. The people of Israel would go into captivity, because of their sins, but God would have compassion upon them and restore them to himself.