David's prayer concerning the counsel (not the person) of Ahithophel.
II Samuel 15:30-31
David does not pray that Ahithophel be turned into foolishness but that his counsel be turned into foolishness. This fact presents a very interesting insight into II Samuel 17:23, "And when Ahithophel saw that his counsel was not followed, he saddled his ass, and arose, and gat him home to his house, to his city, and put his household in order, and hanged himself, and died, and was buried in the sepulchre of his father." Notice the deliberate actions of Ahithophel to end his life. Why would a man commit suicide just because his advice was rejected in favor of a better plan?
To answer this question, we will first disclose the position of Ahithophel in David's kingdom, then we will determine the position of Ahithophel in David's family.
The Position of Ahithophel in David's Kingdom
I Chronicles 27:33, "And Ahithophel was the king's counselor: and Hushai the Archite was the king's companion:". The passage in I Chronicles 27:25-34 gives the "cabinet" during the reign of David. Ahithophel started out as counselor to the king, and after his suicide, Jehoiada and Abiathar took his place. (Ahithophel must have been a pretty fair counselor since it took two men to replace him. As further proof of Ahithophel's skill at counseling, read II Samuel 16:23, "And the counsel of Ahithophel, which he counseled in those days, was as if a man had enquired at the oracle of God: so was all the counsel of Ahithophel both with David and with Absalom." This scripture does not say that Ahithophel inquired of God, but that his counsel was as if he had inquired of God. The Bible indicates that God had to intervene in Ahithophel's counsel or David would have been killed, II Samuel 17:14, "...For the LORD had appointed to defeat the good counsel of Ahithophel, to the intent that the LORD might bring evil upon Absalom." Notice that the counsel of Ahithophel was good, not bad. The intent of the Lord was not to bring evil upon Ahithophel or David, but upon Absalom.)
Ahithophel went with Absalom in his rebellion against David. II Samuel 15:12, "And Absalom sent for Ahithophel the Gilonite, David's counselor, from his city, even from Giloh, while he offered sacrifices. And the conspiracy was strong; for the people increased continually with Absalom." Why would Ahithophel stop giving counsel to David and help with the rebellion?
The answer is found in Ahithophel's position in David's family.
II Samuel 23:1-39. This is the record of David's mighty men. Verse 34, "Eliphelet the son of Ahasbai, the son of the Maachathite, Eliam the son of Ahithophel the Gilonite," Now read II Samuel 11:3, "And David sent and enquired after the woman. And one said, Is not this Bathsheba, the daughter of Eliam, the wife of Uriah the Hittite?" Please note: Eliam is the father of Bathsheba and Ahithophel is her grandfather!! Ahithophel, Bathsheba's grandfather is not considered by David as being a mighty man, but his son, Eliam, the father of Bathsheba, is.
What did Eliam do to be considered a mighty man? His name is mentioned only two times in the Bible. One time is II Samuel 23:34, where he is mentioned as one of David's mighty men, and the other is II Samuel 11:3. From the evidence produced in these scriptures, the only thing Eliam did to be included as one of David's mighty men was to be the father of Bathsheba, but I think it was the "way" he was the father of Bathsheba. Ahithophel, Bathsheba's grandfather, and Eliam, Bathsheba's father, had a completely different attitude concerning David's sin of adultery with Bathsheba. Eliam apparently forgave and tried to make the best of a bad situation, but Ahithophel did not forgive. Reading between the lines, which is risky business in scripture, it seems Ahithophel was bidding his time until he could really hurt David and when the rebellion about Absalom came up, he saw his opportunity to destroy David, so he began giving counsel to Absalom. When his counsel was rejected, Ahithophel saw that his chance to destroy David was ended. This was what caused him to commit suicide, not that his counsel was rejected.
There is one other thing we ought to consider concerning Ahithophel. I do not believe he was a true worshipper of God, although he had all the outward signs. Notice in II Samuel 15:12 that Ahithophel came to Absalom "while he offered sacrifices". Absalom also had an outward show of religion, but his heart was far from God. If Ahithophel was a true worshipper of God, he would not have taken part in Absalom's false worship. As further proof of Ahithophel's false religion, what was the very first advice he gave Absalom? II Samuel 16:20,21, "Then said Absalom to Ahithophel, Give counsel among you what we shall do. And Ahithophel said unto Absalom, Go in unto thy father's concubines, which he hath left to keep the house; and all Israel shall hear that thou art abhorred of thy father: then shall the hands of all that are with thee be strong." Ahithophel's counsel fulfilled the prophecy of Nathan, II Samuel 12:11, but it also causes Absalom to commit adultery for he had a wife and children, although it appears his three sons died before manhood. Compare II Samuel 14:27 with II Samuel 18:18.
I think it is very fair to conclude that if Ahithophel's worship of God had been true, he, like his son, would have forgiven David and the whole story of Absalom's rebellion would have been different. How tragic are the consequences of not forgiving!! How hard unforgiven sins make the heart!!