When Joab came out from David's presence, he sent messengers after Abner, and they brought him back from the cistern of Sirah; but David did not know about it. When Abner returned to Hebron, Joab took him aside in the gateway to speak with him privately, and there he stabbed him in the stomach. So he died for shedding the blood of Asahel, Joab's brother. (2 Samuel 3:26-27, NRSV)
And when Joab was come out from David, he sent messengers after Abner, which brought him again from the well of Sirah: but David knew it not. And when Abner was returned to Hebron, Joab took him aside in the gate to speak with him quietly, and smote him there under the fifth rib, that he died, for the blood of Asahel his brother. (2 Samuel 3:26-27, KJV)
Joab weirdly delays killing Abner until it will be totally inconvenient for David. Vindictive, right? He could've killed him on the battlefield—but Abner convinces him not to. Now, he kills him just after Abner has become David's ally.
But Absalom pressed him until he let Amnon and all the king's sons go with him. Absalom made a feast like a king's feast. Then Absalom commanded his servants, "Watch when Amnon's heart is merry with wine, and when I say to you, 'Strike Amnon,' then kill him. Do not be afraid; have I not myself commanded you? Be courageous and valiant." So the servants of Absalom did to Amnon as Absalom had commanded. Then all the king's sons rose, and each mounted his mule and fled. (2 Samuel 13:27-29, NRSV)
But Absalom pressed him, that he let Amnon and all the king's sons go with him. 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. And the servants of Absalom did unto Amnon as Absalom had commanded. Then all the king's sons arose, and every man gat him up upon his mule, and fled. (2 Samuel 13:27-29, KJV)
Finally, two years later, Absalom avenges the rape of Tamar. Given the lack of legal action by David's government, you could argue that it's not so bad for Absalom to go all vigilante on the situation (if you want to take a Clint Eastwood kind of perspective).
When they were at the large stone that is in Gibeon, Amasa came to meet them. Now Joab was wearing a soldier's garment and over it was a belt with a sword in its sheath fastened at his waist; as he went forward it fell out. Joab said to Amasa, "Is it well with you, my brother?" And Joab took Amasa by the beard with his right hand to kiss him. But Amasa did not notice the sword in Joab's hand; Joab struck him in the belly so that his entrails poured out on the ground, and he died. He did not strike a second blow. (2 Samuel 20:8-10, NRSV)
When they were at the great stone which is in Gibeon, Amasa went before them. And Joab's garment that he had put on was girded unto him, and upon it a girdle with a sword fastened upon his loins in the sheath thereof; and as he went forth it fell out. And Joab said to Amasa, Art thou in health, my brother? And Joab took Amasa by the beard with the right hand to kiss him. But Amasa took no heed to the sword that was in Joab's hand: so he smote him therewith in the fifth rib, and shed out his bowels to the ground, and struck him not again; and he died. So Joab and Abishai his brother pursued after Sheba the son of Bichri. (2 Samuel 20:8-10, KJV)
Joab is understandably annoyed at losing his old job to Amasa, Absalom's former commander. But here, he does the worst thing he's done since helping David kill Uriah. The act of revenge against Abner was wrong but understandable, but killing Amasa is needless bloodshed. (And—spoiler alert—doesn't bode well for Joab in 1 Kings.)
The Gibeonites said to him, "It is not a matter of silver or gold between us and Saul or his house; neither is it for us to put anyone to death in Israel." He said, "What do you say that I should do for you?" They said to the king, "The man who consumed us and planned to destroy us, so that we should have no place in all the territory of Israel—let seven of his sons be handed over to us, and we will impale them before the Lord at Gibeon on the mountain of the Lord." The king said, "I will hand them over." (2 Samuel 21:4-6, NRSV)
And the Gibeonites said unto him, We will have no silver nor gold of Saul, nor of his house; neither for us shalt thou kill any man in Israel. And he said, What ye shall say, that will I do for you. And they answered the king, The man that consumed us, and that devised against us that we should be destroyed from remaining in any of the coasts of Israel, Let seven men of his sons be delivered unto us, and we will hang them up unto the Lord in Gibeah of Saul, whom the Lord did choose. And the king said, I will give them. (2 Samuel 21:4-6, KJV)
Hey—different strokes for different folks. And these strokes are pretty gruesome. Strangely enough, God seems to be endorsing the Gibeonites impale-a-thon. At least, he ends the famine after they do it.