David I was the youngest son of Malcolm III Canmore and his wife, Margaret, daughter of Edward Atheling (and therefore grand-daughter of the English king Edmund Ironside). He was born circa 1080CE. His younger years were spent in England, where he became used to the Norman style of life. His younger sister, Maud or Matilda, married the English king Henry I.
On the death, in 1107, of his brother Edgar, king of Scotland, David inherited, as an independent earldom, all of Scotland south of the Forth-Clyde divide, whilst his older brother, Alexander inherited the Scots throne, and governance over the northern districts. When Alexander died, in 1124, David suceeded to the crown of the whole nation.
By that time, he had married, to Matilda, daughter of the English Earl of Northumbria, and had become Henry I's Earl of Huntingdon, and thereby an English baron. As such he swore fealty to the Empress Matilda, as heiress to Henry I, and when Stephen usurped the English throne in 1135, David invaded England in support of her cause (not to mention in hope of winning Northumbria for himself). Met by a strong army, he made peace, but broke it by invading again in 1138, when he was defeated near Northallerton.
He retreated as far as Carlisle, and made peace again, gaining the Earldom of Northumbria from Stephen, but joined Matilda in London in 1141. He came close to capture on this adventure and retired to his own country, to build it up. He died at Carlisle in 1153 and, since both his sons were dead, he was succeeded by his 12 year old grandson, Malcolm IV, son of his son Henry, Earl of Huntingdon, and Adela, daughter of the Earl of Surrey.
David supported the Scots Church, especially in its role as the main instrument of teaching, and founded religious houses to support this. He founded the bishopric of Glasgow, and used monks as his bureaucracy and advisors, on the Anglo-Norman model. He also made land grants to many Anglo-Norman families, thus strengthening Scotland's feudal aristocracy, and used this process to accelerate Scotland's modernisation. He also supported Scots trade and commerce, and established Scotland's first Sheriffdom (at Roxburgh).
His mother, Margaret, was later (1251) canonised, and David acquired the cognomen "the Saint", for his efforts for the Church.