Notice the contrast. The consequences of idolatry amongst a people are seen to the third and fourth generation where hatred of God is present. But the covenantal faithfulness of God is to a thousand generations of those who love and obey him, despite our failures and backslidings.