Homo sapiens originated in Africa about 200,000 years ago and then migrated north into Europe and Asia about 70,000 years ago. When they arrived in Eurasia, Homo sapiens found two other hominid cousins already occupied the Eurasian landmass: Neanderthals and Denisovans.
As humans migrated throughout the Eurasian landmass we interbred with the Neanderthals, which led to Neanderthal DNA being part of the Homo sapien gene pool. Note, however, that because indigenous Africans did not migrate out of Africa they did not interbreed with Neanderthals and thus do not have any Neanderthal DNA.
The determination that most modern humans have some Neanderthal DNA is possible because scientists have been able to sequence the Neanderthal genome from skeletal remains. A recent study compared the genomes of Neanderthal skeletons found in Croatia and Siberia with the genomes of early and modern humans and found the following:
A proportion of the genomes of all present-day people whose roots are outside Africa derives from Neanderthals. We find that non-African populations outside Oceania carry between 1.8 and 2.6% Neanderthal DNA, higher than previous estimates of 1.5 to 2.1% . East Asians carry somewhat more Neanderthal DNA (2.3 to 2.6%) than people in Western Eurasia (1.8 to 2.4%). Science
Below is a diagram from the study showing the degree of Neanderthal DNA by human population location:
Because most humans have some Neanderthal DNA, scientists are re-thinking the hypothesis that humans were violent towards the Neanderthal and may have been a factor in their extinction due to humans hunting and killing them. Instead, “perhaps our ancestors made love, not war, with their European cousins, and the Neanderthal lineage disappeared because it was absorbed into the much larger human population.” Source.