Answer
Orkney and Shetland, previously Norwegian, became Scottish as part of the dowry of Margaret, daughter of King Magnus VI of Norway, when she married King James III of Scotland in 1469. This acquisition extended Scottish control over the Northern Isles and strengthened its strategic position in the North Atlantic.