A lot happens in this chapter that is well known that we have to look at. First of all, remember the last chapter we left off with Joshua and Caleb pretty much being the only ones who said that the land that they spied out is pretty amazing, in fact it is a land flowing with milk and honey. But the people chose to follow the words of the other 10 who said that the land is inhabited by giants so there is no way that God would ever be able to overcome them. In vs.4 of this chapter it gets so bad that the Israelites say: Let's choose one from each tribe who will lead us and take us back to Egypt. The assumption is that Moses' time as our leader is finished. We are doing this on our own. And the this is to go back to to Egypt where we were slaves, because it has to be better than what we have now.
As a result of this infidelity of the people God decides to strike them all down and kill them (vs.12). Moses intercedes for them and reminds God in vs. 18 that His holy Word once said: "The Lord is slow to anger, and abounding in steadfast love, forgiving iniquity and transgression..." These are all words that the Israelites needed at this time. So God responds to this appeal by saying: I do forgive, but none of these people who plotted against you, so against me, shall see the promised land.
He sets the time that they will be wandering in the wilderness where they will do, for one year for every day that the people spied out the land, which would be 40 years since they spied out the land 40 days. But only Joshua and Caleb are going to be able to enter the land. When the word gets back to the people, as you would expect, they were remorseful. They had a great idea. Let's show God that we are on his side and that we won't do that again and let's go and take the land over, that should show him. Moses tells them, don't do that, God is not with you, not a good idea. They try to invade the land and they are repulsed and slaughtered, Not all of them, but enough of them to leave a mark.
We now have the stage set for the people of Israel to die off so that their kids can take over the promised land...