Following David’s awful sin of adultery with Bathsheba and the ensuing arranged murder of her husband, Uriah, he was confronted by Nathan the prophet. Among the consequences of his sins were that from his own household enemies would arise against him (2 Sam 12:10-11). Three of his sons—Amnon, Absalom, and Adonijah—each caused serious problems for him and his successor, Solomon (2 Sam 13; 14-17; 2 Kings 1-2). There was another person, whose name also began with an “A,” who rose up against him as a betrayer. This man, Ahithophel, had been a close advisor to David and could even have been called “the smartest man in the world.”
Now in those days the counsel that Ahithophel gave was as if one consulted the word of God; so was all the counsel of Ahithophel esteemed, both by David and by Absalom” (2 Sam 16:23).
He evidently came out of his own retirement and joined the revolt of Absalom as his trusted advisor (2 Sam 16:23).
What is often overlooked, however, is that Ahithophel evidently became part of David’s family by marriage. Two passages explain that Ahithophel was the grandfather of Bathsheba (cf. 2 Sam 11:3 with 23:34). One need not speculate too much to see that when David “took” Bathsheba (2 Sam 11:4), Ahithophel must have left David’s service. Later, the crafty Absalom must have assumed (correctly) that Ahithophel would jump at the opportunity to get revenge against David so he asked him to come out of retirement—an offer that the old man simply could not refuse.