Absalom was killed when he was fleeing after he had won a war against his father. On his way home, his hair got stuck in branches. Then out of the brush, Joab comes and stabs him in the heart with small daggers. This doesn't kill him, so Joab gets some men to beat him with sticks. Even though Joab was specifically told not to kill Joab, he still did, and David hated him for it.