Since there was a battle in which the Israelites lost, the man had to escape from the Israelite camp without being seen by Philistines. The Philistines would have overrun the camp in search of straggling Israelite soldiers to kill, and he had to travel in such a way that he was not found by Philistine raiding parties.
3 David said to him, “Where do you come from?” And he said to him, “I have escaped from the camp of Israel.”