A hunter-gatherer or forager is a human living in a community, or according to an ancestrally derived lifestyle, in which most or all food is obtained by foraging, that is, by gathering food from local naturally occurring sources or by hunting game. This is a common practice among most vertebrates that are omnivores. Hunter-gatherer groups, usually a few dozen people, were and are nomadic or semi-nomadic. Hunter-gatherer societies are contrasted with more sedentary agricultural societies, which rely mainly on cultivating crops and raising domesticated animals for food production.
Hunting and gathering emerged with Homo erectus about 1.8 million years ago and was humanity's original and most enduring successful competitive adaptation in the natural world, occupying at least 90 percent of human (pre)history. Following the invention of agriculture, hunter-gatherers who did not change were displaced or conquered by farming or pastoralist groups in most parts of the world. In Western Eurasia, farming and metallurgical societies gradually replaced hunter-gatherers, but dense forests remained their last refuge until Bronze and Iron Age societies fully overcame them.