Scotland is geologically alien to the rest of Europe, having been part of the ancient continent of Laurentia (later North America). Laurentia moved north from below the equator towards the Baltica continent (later Scandinavia). With the final collision the Scottish part of Laurentia smashed into Avalonia (containing what is now England and Wales), previously joined to Baltica.
This impact saw the formation of the massive granite West Highland and Grampian Mountains (as high as the Alps at the time) and a period of important volcanic activity.
Much later Laurentia and Eurasia were pushed apart (parting Scotland from Laurentia). This created the Atlantic Ocean and led to renewed volcanism on the Scottish west coast producing the mountains of Skye, Jura, Mull, Rum and Arran.
The various ice ages massively eroded most of this mountainous landscape and it was only after the last ice age had receded (about 20,000 years ago) that Scotland became habitable again.