i.e. Having been in the wilderness; which is an easy and common ellipsis. Or, because of (so the Hebrew particle beth is oft used) the wilderness, which they have passed through, in which provisions are very scarce.
Related Commentaries of 2 Samuel 17:29
2 Samuel 17:29
29 And honey, and butter, and sheep, and cheese of kine, for David, and for the people that were with him, to eat: for they said, The people is hungry, and weary, and thirsty, in the wilderness.