‘The Lord tells Moses of his impending death and then prophesies that “this people will begin to prostitute themselves to the foreign gods in their midst…breaking my covenant that I have made with them” (vs. 16). The Lord will have to judge them accordingly (vs. 17–18). He then inspires Joshua to write a song for them to sing when trials come upon them (vs. 22–23).
The omniscient Lord perfectly knows the hearts of humans, the long range effects of sin, and all the spiritual variables at work in the world (viz. the activity of evil spirits). This perfect knowledge of the present gives God the ability to anticipate the future in ways we can hardly imagine. For, at any given moment, a great deal of the future has already been decided by past and present circumstances.
This prophecy illustrates this truth. Given the rebellious character that this nation had already demonstrated despite the fact that they had a strong leader like Moses, the Lord discerns that things will only get worse when Moses dies. Such foresight doesn’t require a crystal ball perspective into the future. It simply illustrates God’s perfect knowledge of the present.
On the other hand, the prophecy could be read as a conditional prophecy of what the Lord suspects might happen if things don’t change. But (as evidenced by his subsequent struggles with Israel) he hopes it doesn’t come to pass and he does everything possible to prevent it.’
source: Gregory Boyd (reknew).