Castle building came to Scotland in the late 11th and early 12th Centuries. It was not through conquest or occupation as was the case in England, but as a result of deliberate political policy. King Malcolm III and his son King David I both spent time in Norman England and were heavily influenced by Norman culture and traditions.
David I brought feudalism north to Scotland, along with a host of foreign knights and lords who were offered land to come and settle. Under David these Anglo-Norman lords built motte and bailey castles with timber towers, just as they had in England, and within a few decades were holding and governing lands as far north as Speyside and Moray.
Stirling Castle lit up at night
William the Lion, who reigned in the late 12th Century, extended and consolidated his rule by building castles in the south at Lanark, Dumfries and Ayr and in the north at Dunskaith on Cromarty Firth and Redcastle on Beauly Firth. Much of the far north of Scotland was under Norse rule at this time. They didn't assign much importance to castle building and only a few were built at this time, including Cubbie Row in the Orkneys.
In the south of the country, the border between Scotland and England was, for centuries, very poorly defined with large areas claimed by both sides at once. The Borders were wild, lawless lands where raiding, cattle reiving and sheep lifting were a way of life. Most of the castles built in the Borders were tower houses which first started to appear in the late 13th Century. They were a redesign of the medieval hall-house with the rooms now extending vertically for defense. The first ones were quite simple rectangles, but later designs formed L-shaped plans with flanking wings and Z shaped plans which protected fully against flanking fire.
Eilean Donan Castle, Loch Duich, Scottish Highlands
Many of the great Scottish stone castles were not built where a modern visitor might expect them to be. The border was always contentious, but the Kings of Scotland had enemies and problems in other directions too. The regional rulers (mormaers) of Ross and Moray were practically rulers of a separate countries and were quite prepared to ignore the king in distant Dunfermline. In the south too, Galloway had a substantial Gaelic-speaking population and was always rebellious in the Middle Ages. Some of the other castles, like Duart Castle and Castle Tioram, were built to protect and control important seaways and drove roads for cattle heading south.
Over time the kingdom prospered and the role of the castle moved from that of defensive retreat to luxury abode and status symbol. After 1680 many wealthy Scottish families had the money and vision to build new palaces that combined Scottish traditions with modern ideas and fashion from Europe.
There is something about the Scottish landscape that encouraged patrons and architects to construct new buildings with towers and adorn them in a Scots baronial style. Castle building then, continued well into the modern industrial age in Scotland and quite a few older castles also received a romantic Gothic or Scots baronial makeover in the nineteenth century.
Blair Castle in Perthshire