AndthekingsaiduntoJoab - It appears that Joab was present at the time when the woman was in conference with the king, and no doubt others of David's courtiers or officers were there also.
Matthew Henry
Concise Bible Commentary
David was inclined to favour Absalom, yet, for the honour of his justice, he could not do it but upon application made for him, which may show the methods of Divine grace. It is true that God has thoughts of compassion toward poor sinners, not willing that any should perish; yet he is only reconciled to them through a Mediator, who pleads on their behalf. God was in Christ reconciling the world to himself, and Christ came to this land of our banishment, to bring us to God.
SDA Bible Commentary (limited)
Volume 1-7
21. Bring the young man. Joab had attained his purpose, and the king wisely commissioned him to carry the tidings to Absalom and to bring him home.