After securing his hold over majority of England, William the Conqueror invaded Scotland in 1072. According to the Anglo-Saxon Chronicle:
This year King William led a naval force and a land force to Scotland, and beset that land on the sea-side with ships, whilst he led his land-force in at the Tweed; but he found nothing there of any value. King Malcolm, however, came, and made peace with King William, and gave hostages, and became his man; whereupon the king returned home with all his force.
One possible reason for William’s invasion of Scotland had to do with a marriage alliance between Malcolm and Margaret, the sister of an English noble Edgar Atheling. The marriage alliance threatened greater Scottish influence in Northumbria, an area disputed by England and Scotland, and so William went north to deal with the threat.
Malcolm submitted and became William’s vassal and gave him hostages, one of them being his eldest son Duncan, but in 1079, Malcolm once again invaded Northumbria. The Anglo-Saxon Chronicle says:
This year came King Malcolm from Scotland into England, betwixt the two festivals of St. Mary, with a large army, which plundered Northumberland till it came to the Tine, and slew many hundreds of men, and carried home much coin, and treasure, and men in captivity.
William was forced to deal with Malcolm, and he made the Scottish king submit yet again. Then in 1091, four years after the death of William, Malcolm marched on England while William Rufus was in Normandy reconciling with his brother, Robert Curthose.
The King Malcolm of Scotland came hither into England, and overran a great deal of it, until the good men that governed this land sent an army against him and repulsed him. When the King William in Normandy heard this, then prepared he his departure, and came to England, and his brother, the Earl Robert, with him … when the King Malcolm heard that they were resolved to seek him with an army, he went with his force out of Scotland into Lothaine in England, and there abode. When the King William came near with his army, then interceded between them Earl Robert, and Edgar Etheling, and so made the peace of the kings, that the King Malcolm came to our king, and did homage.
Still, King Malcolm was not satisfied, and in 1093, he gathered an army and invaded Northumbria, but the forces of Earl Robert of Northumbria killed him in battle near the river Aln. After the Scottish king’s death, Malcolm’s brother Donald was elected king by the Scots.
Green, Cynthia Whidden. “Saint Kentigern, Apostle to Strathclyde: A Critical Analysis of a Northern Saint.” Medieval Sourcebook. 1998.