Razib Khan sums up a recent paper comparing the gender composition of newcomers to Europe, first among the first wave of farming in the Neolithic era, and then in the major demic upheaval that accompanied the arrival of Indo-Europeans from the Steppe into Europe in the Bronze Age.
The Neolithic populations were gender balanced, probably migrated as families colonizing virgin farmland starting in Anatolia and then to Southeast Europe ca. 8000 years ago and from there West and North, after a formative period during which a Near Eastern population mixed with European hunter-gatherers. But, they didn't admix with local populations much for many centuries until farming hit its first major widespread, but temporary, collapse. Remaining hunter-gatherer populations were at that point enriched in the gene pools during this bottle neck.
The Indo-European migrants from the steppe, ca. 5000 years ago, in contrast, probably came in armed war bands on horses with men outnumbering women in ratios somewhere between 14-1 and 5-1. They took local wives at the expense of local men who were squeeze out of the gene pool by death or simply denial of local women to marry. This process continued for multiple generations, rather than in a single pulse.
Further Back In Time
There were also several waves of migration before the Neolithic Revolution.
Neanderthals were the dominant hominins of Europe from more than 200,000 years ago until about 40,000 years ago (in round numbers). They probably evolved locally from more archaic hominins who migrated to Europe from Africa. Their time period is known as the Lower Paleolithic era.
In round numbers, ca. 40,000 years ago, early modern human hunter-gatherers called Cro-Magnons swept into Europe from the Southeast and largely replaced the Neanderthals who had lived in Europe in smaller number with a hunting style focused more exclusively on large game than the new Cro-Magnon population. This was near the beginning of an era known as the Upper Paleolithic era. At the time the Cro-Magnon people migrated to Europe, modern humans had already been outside Africa from many thousands of years, but presumably because that territory was already taken by the Neanderthals, it took modern humans longer to penetrate Europe.
The Cro-Magnon people had it good for a while, but eventually, the climate cooled and glaciers came to cover most of Northern Europe banishing them to three main refuges, the Franco-Cantabrian one, one in Italy, and one in the Southeastern Mountains, where temperatures were tolerable. This ice age was at its peak roughly 20,000 years ago.
Several thousand years later, the glaciers retreated, the Cro-Magnon people in the refuges repopulated Europe and they were joined by new people from the Near East and North Africa during a time period known as the Mesolithic era. This population that had a few thousand years earlier repopulated Europe was the population of hunter-gatherers who were in Europe when the first farmers of the Neolithic Revolution arrived.