2 Samuel 13:28
Now Absalom had commanded his servants, saying, Mark ye now when Amnon’s heart is merry with wine, and when I say unto you, Smite Amnon; then kill him, fear not: have not I commanded you? be courageous, and be valiant. Now Absalom had commanded his servants, saying, Mark ye now when Amnon’s heart is merry with wine, and when I say unto you, Smite Amnon; then kill him, fear not: have not I commanded you? be courageous, and be valiant.
Absalom avenged Amnon's crime against his sister by having his servants kill him. As the natural protector of his foully wronged sister, he avenged Amnon's shameful, incestuous crime. He concealed his purpose of revenge for two full years in order to strike more surely, then struck when Amnon's heart was merry with wine at a feast of the king's sons. The drunken Amnon was slain by Absalom's servants at his command.
David, self-condemned for his own sin, had permitted Amnon's crime to pass unpunished and unrebuked. This was though the law pronounced death upon the adulterer, and Amnon was doubly guilty. The killing formed part of the judgment then meted out to David and was bitter fruit of David's own wrongdoing. In the killing, David's sons were acting over the sins he had committed.
It kept David's sin continually before his mind. It continually reminded him of the injustice he had done to Uriah and Bath-sheba. It made him feel the full weight of that injustice.