Thirteen thousand years ago Scotland was covered by glaciers. Nobody lived there. Then the glaciers retreated and immigrants started to arrive from the south. The current population of Scotland are the descendants of successive waves of invaders and immigrants. For example, the Vikings came here as invaders and their genes are present in high percentages of the population in certain parts of the country.
As well as creating burghs the remarkable David I brought many members of the French nobility to Scotland to civilise the country during the Davidian Revolution. The Grant, Fraser and Bruce clans [and several others] sound so Scottish but are actually the descendants of French/Norman nobility brought to Scotland by David I.
The famous Robert the Bruce was actually Robert de Brus [or Robert de Bruys], a descendant of a French/Norman noble family. The name is a derivation of Brix of the Manche department in Normandy, France.
Scotland is a real genetic melting pot.
Between 1815 and 1914 thirteen million Scots emigrated to the USA. Another four million went to Canada and one and a half million to Australia. A total of 18.5 million. Remarkable figures given that the current population of Scotland is less than five and a half million. It means that over three times as many Scots left Scotland in the century before the First World War as now remain.
Actually, the above figures underestimate the level of emigration. They do not include those that went to South Africa and New Zealand or died in some lonely imperial outpost; playing the Great Game in India, growing tea and rubber in Malaya and in the Thin Red Line at Balaclava. Most importantly, it does not include the numbers who left Scotland to run England. I do not know the total numbers for Scottish emigration for 1815 to 2010 but I would be surprised if it was less than 30 million. In other words, about six times as many left as now remain.
It has been said of the Portuguese that they have a small country for their cradle but the whole world for their grave. That is even more true for the Scots.
If you were unkind you could also say that Scotland is currently populated by the sad genetic residue of those who did not have the enterprise to get up and go. The 'left behind' of the Scottish Rapture.