You shall remember all the way which the LORD your God has led you in the wilderness these forty years, that He might humble you, testing you, to know what was in your heart, whether you would keep His commandments or not. Deuteronomy 8:2
Absalom could not possibly have stood outside the gate of Jerusalem stealing the hearts of Israel for 40 years (2Sam.15:7). His father, King David, only reigned for a total of 40 years, and 7 of those years were in Hebron, not Jerusalem. So the numbers just don’t work.
I’ve heard theories explaining the numbers, eg. a translation error. But I believe the Holy Spirit placed the number 40 in 2 Samuel 15 deliberately. Every number, every place name, every detail in Scripture is profitable for teaching (2Tim.3:16).
The number 40 symbolizes “testing” in Scripture. We know this because God “tested” the nation of Israel in the wilderness for 40 years to see whether or not they would follow Him (see Scripture above). Jesus’ 40 days in the wilderness echoes those 40 years. Like Israel, Jesus was tempted by hunger (Ex.16), tempted to put God to the test (Ex.17) and tempted to idolatry (Ex.32), yet without sin.
Another example of 40 as a period of testing is in Judges. Judges is a dismal cycle of Israel turning away from God, Him allowing their enemies to oppress them, and Israel once again turning her face to God. Each time during the cycle, the land would have peace for 40 years (Judges 3:11; 5:31; 8:28; 13:1) as Israel was tested to see if they would follow God. Alas, they again did evil in the sight of the Lord, and the cycle continued.
This is why I am convinced that the Holy Spirit mentioned the number 40 in 2 Samuel 15:7 for a purpose. We are meant to ask the question, “Who is being tested here?”
It is not Absalom; he has already crossed over to the dark side. He is a type and shadow of satan here. It is the nation of Israel being tested yet again. Are they going to follow God’s anointed, King David, or are they going to follow the usurper?
And the same question comes down to us today. Who are we going to follow? Are we going to follow God and His Anointed One? Or are we going to follow the usurper?
The answer to this question is critical. It determines where we will spend eternity – in a pit or with The King.