Amasa is a person in the Hebrew Bible. He was the son of Abigail (2 Sam 17:25), who was sister to King David (1 Chr 2:16,17) and Zeruiah, the mother of Joab. Hence, Amasa was a nephew to David, a cousin to Joab, as well as a cousin to Absalom.
Absalom, David's mutinous son, revolted and won over the tribes of Israel (2 Sam 15). He appointed Amasa over the army, in effect replacing Joab, who had been general for Absalom's father David.
After the revolt was crushed, David held out an olive branch to Amasa (in a likely effort to appease and reunite Judah with the other 10 tribes of Israel) by offering to appoint Amasa as his new army commander (2 Sam 19:13). While being fiercely loyal to David, Joab was also suspicious of any potential rivals for Joab's power or threats to David's kingdom, and had no qualms about taking the lives of any who might stand in his way (E.G., Abner: 2 Sam 3:27, and Absalom: 2 Sam 18:14). So it was not difficult for Joab to also decide to murder Amasa (2 Sam 20:10, 1 Kin 2:5,32). Joab's own justification for killing Amasa may have been because he believed Amasa to be conspiring with Sheba son of Bichri the Benjamite, due to Amasa's slowness to mobilize the army against Sheba's rebels (2 Sam 20:4,5).