Right after the Absalom rebellion ends, another starts. A "scoundrel" named Sheba gets all the people of Israel to follow him in rebellion. But Judah stays with David.
David takes the ten concubines who slept with Absalom and has them live in a separate house. He provides for them, but doesn't pay them any visits, if you know what we mean.
To deal with Sheba's rebellion, David sends Amasa to summon the people of Judah. However, he ends up taking a long time, so Daniel tells Abishai to take his men and pursue Sheba.
Joab brings his men along with Abishai, too. When they meet up with Amasa, Joab (likely remembering how Amasa replaced him) acts like he's going to greet Amasa and kiss him. But, instead, he takes out his sword, and slices Amasa's guts open with one stroke. Amasa dies, obvi.
Kicking It Ichabod Crane Style
One of Joab's soldiers hides Amasa's body (still half-alive at this point) on the side of the road, while everyone else rides on to follow Joab into battle against Sheba.
They pursue Sheba until they trap him in a city called Abel, in Beth-Maacah. As they prepare to besiege the city, a wise woman comes out to talk to Joab.
She tells Joab that this is a peaceful city and that they don't want any trouble.
Joab says he's not looking for trouble, he just wants to capture Sheba and kill him.
So the wise woman goes to the people of Abel, and they agree to kill Sheba. They chop his head off and throw it over the city walls to Joab.
Joab leads the troops back to Jerusalem—and, now, with Amasa dead, he's the general in charge of the whole army again.