God knew (and knows) all too well what people are like. He offered the Israelites the choice of having God who ‘lived among them’ and a good life, if only they obeyed all the rules, including keeping the Sabbaths.
26:11-12 I will live among you, and I will not despise you. I will walk among you; I will be your God, and you will be my people.
As if God knew what was coming, He spelled out the price of disobedience in very clear terms. It ended up as a prediction of the history of Israel: idol worship and moral decay, followed by disease, invasion, drought, death, plagues, more death, and exile from Canaan (soon to be Israel), until the land had been rested for every Sabbath year that had not been observed.
Oh, and any remnant would be totally demoralised. The pride of the Israelites, which ignored their dependence on God, who owned the land and the people, would eventually be dealt with.
26:41 When I have turned their hostility back on them and brought them to the land of their enemies, then at last their stubborn hearts will be humbled, and they will pay for their sins.
And eventually, God hoped they would return to Him:
26:44-45But despite all this, I will not utterly reject or despise them while they are in exile in the land of their enemies. I will not cancel my covenant with them by wiping them out, for I am the Lord their God. For their sakes I will remember my ancient covenant with their ancestors, whom I brought out of the land of Egypt in the sight of all the nations, that I might be their God. I am the Lord.