"Therefore a lion from the forest will attack them, a wolf from the desert will ravage them, a leopard will lie in wait near their towns to tear to pieces any who venture out, for their rebellion is great and their backslidings many." NIV translation
In Leviticus 26, God told Israel that this would be the punishment for disobedience. Backsliding is where you know what it required but dig in your heels and resist. This is not accidentally breaking some rules but is outright rebellion.
"'Why should I forgive you? Your children have forsaken me and sworn by gods that are not gods. I supplied all their needs yet they committed adultery and thronged to the houses of prostitutes.'" NIV translation
The next generation had already been taught to follow the sins of their fathers.
Can you imagine raising a child and providing for all of their needs but them calling another person mommy or daddy?
"'They are well-fed, lusty stallions, each neighing for another man's wife. Should I not punish them for this?' declares the Lord. 'Should I not avenge myself on such a nation as this?'" NIV translation
They had all that they needed and yet looked to other gods. The simple answer to these questions is that it is perfectly right and just for the Creator of all things to punish a disobedient creation.
"'Go through her vineyards and ravage them, but do not destroy them completely. Strip off her branches, for these people do not belong to the Lord. The people of Israel and the people of Judah have been utterly unfaithful to me,' declares the Lord." NIV translation
Even though all are guilty and deserving of punishment, we see that, in His mercy, God spares a remnant. This is a pattern that occurs throughout the history of Israel and continues even to this day.
"They have lied about the Lord; they said, 'He will do nothing! No harm will come to us; we will never see sword or famine. The prophets are but wind and the word is not in them; so let what they say be done to them.'" NIV translation
Their religious leaders and prophets were saying that God would not punish them because they were His chosen people. It is much the same way with the world today as many say that everyone should just get along and there are many paths to salvation. Many say that God will not judge people as long as they are trying to do the best they can. This is nonsense and we should remember that the events that are described here did happen.