This was done by a shared work division. Some people in a hunter-gatherer community were designated to hunt, others to forage, some tended to their current encampent, others scouted, etc.
Such a division led to an effective way of obtaining goods from a certain environment which also consequently helped these people in obtaining the different things they needed for survival.