David had said that whoever attacked the Jebusites first would become a commander, and Joab was the first to attack them.