The instruction to retreat from the war camp is designed to ensure a quiet departure, preventing any friction with the Philistine leadership. The order to leave peacefully specifically directs David to head back to his home in the city of Ziklag [ביאור שטיינזלץ]. However, a different perspective suggests that this dismissal is aimed at David alone. According to this view, the intention is for his men to remain and march alongside the military camp, while he himself is required to turn back [מלבי״ם].
Furthermore, the demand to avoid angering the Philistine lords is a straightforward warning to refrain from any action they might view negatively [מצודת דוד]. This strict caution is specifically intended to prevent the Philistine leaders from feeling provoked and starting a direct confrontation [מלבי״ם].