The pain of betrayal by a trusted friend cuts far deeper than the hostility of a known opponent. When a close confidant suddenly turns against someone, it creates a profound sense of brokenness. The primary approach among commentators is that these feelings are directed at Ahithophel, King David's closest advisor and friend, who unexpectedly joined a rebellion against him. If a recognized adversary had publicly shamed or cursed him, the king could have tolerated the abuse and carried the burden of the insult [שטיינזלץ, מצודת ציון]. An attack from a clear opponent, much like the historic insults from Shimei ben Gera, is simply easier to absorb [אלשיך]. Alternatively, considering King David's past, he never accepted insults from enemies in silence but would actively strike back. In this specific situation, however, he is forced to swallow the humiliation against his will because the person attacking him is a great Torah scholar [רש״י].
Similarly, if an open hater had suddenly risen up, issued threats, or spoken evil against him [רד״ק, אבן עזרא], the king would have known exactly how to react. He would have found a way to hide and protect himself, just as he successfully evaded King Saul during his years on the run [אלשיך, שטיינזלץ]. The true agony stems from the disguise of the hostility. Because the attacker presented himself not as a rival, but as a trusted confidant who knew all of the king's hidden secrets, King David never thought to put up his guard. While a person can endure the shame of a public adversary or take shelter from an open threat, it is impossible to defend against a friend who turns on you [אבן עזרא, מצודת דוד, מאירי].
Furthermore, there is a distinction between different levels of ill will, where a general hater holds a milder anger than a full enemy. Yet, the heartbreak here is that the betrayers never belonged to either category beforehand. Prior to the rebellion, Ahithophel was a cherished advisor, and Absalom was the king's own son [מלבי״ם].