David Stewart, as eldest son of the King Robert III of Scotland and his Queen, Anabella Drummond, was heir to the throne of Scotland. In 1399, at the age of 21, he was appointed "Lieutenant" of the kingdom, partly due to the infirmity of his father and at a time of civil unrest and conflict with England. Although this gave him an opportunity to flex political muscle, his room for manoeuvre was significantly constrained, however, by a combination of youthful inexperience and the ultimately mortal rivalry of his uncle, Robert Stewart, who had been protector of the kingdom prior to David's lieutenancy. Albany was a ruthlessly effective politician with a well developed power base, and his designs on the throne were well understood. David's subsequent marriage to Marjorie, forming a Douglas alliance with the throne, also caused a serious rupture with George Dunbar the tenth Earl of March, whose daughter Elizabeth had originally been betrothed to the Prince. David is known to have involved himself in the political life of the kingdom, playing a role for instance in peace negotiations with John of Gaunt in the Marches.
David appears to have had an ally in his mother, the Queen, who had worked to strengthen her son's hand, arranging the great tournament of 1398 in Edinburgh when he was knighted and being present, along with the king, in that same year when David was created Duke of Rothesay, in the same ceremony, performed by Walter Trail, Archbishop of St Andrews, which also created the title Duke of Albany for his uncle. But both the Queen and Archbishop were dead by 1401. His father, the King, appears to have had little ability by that date to influence events effectively.
In late February 1402, while travelling officially to St Andrews, David was arrested just outside the city at Strathtyrum in a sting operation which had been arranged by Albany, at that time in complicit alliance with Archibald, fourth Earl of Douglas. (David's father-in-law, the highly influential third Earl, had died two years before, in 1400.) The pretext for David's arrest was that his lieutenancy had expired. He was initially held captive in St Andrews Castle, and soon afterwards taken to Falkland Palace, Albany's residence in Fife. According to Bower, the prince spent the journey hooded and mounted backwards on a mule. At Falkland David remained a prisoner and shortly died there, reputedly of starvation. A few weeks later, in May 1402, a public enquiry into the circumstances of David's death exonerated Albany of all blame.
Four years later, in 1406, David's younger brother, James Stewart, succeeded Robert III as king (although at that time remaining uncrowned and in captivity in England) while Albany secured himself as de facto ruler of Scotland.