We learn from Numbers 13-14 that Moses sent 12 spies (one from each tribe) into the land of Canaan to see what things looked like there. We know that the land was fruitful and productive but ten of the spies thought they were not sufficiently strong to overpower the people of the Land. Only Joshua and Caleb felt that they could accomplish the task. The people wanted to stone Joshua and Caleb. The Lord pronounced that the people would now spend one year in the wilderness for each day that the spies spent in the land of Canaan. That would add up to forty years until all the rebellious had died off.
There is a powerful type here in understanding the purpose of the Millennium which was represented by the forty years in the wilderness. Like a paradisiacal state, food and clothing were supplied to the children of Israel. They ate manna and their clothing and shoes did not wear out. By having all the rebellious die before they could enter the promised land they became a new creature in Christ having rid themselves of their rebellious nature. It must be remembered that they left Egypt as if they were one person and that person was Christ (see Exodus 4:22-23, Hosea 11:1, and Matthew 2:15 below) so this forty years gave them the time to conform to the image of the Son. One of the major purposes of the Millennium is for us to rid ourselves of all Telestial traits and to conform to the image of the Son while the earth is transfigured and baptized by fire and the Holy Ghost.
22 And thou shalt say unto Pharaoh, Thus saith the LORD, Israel [is] my son, [even] my firstborn:
23 And I say unto thee, Let my son go, that he may serve me: and if thou refuse to let him go, behold, I will slay thy son, [even] thy firstborn.