Robert I (also Robert the Bruce) was the son of Robert de Brus, 6th Lord of Annandale, and of Margaret his wife, who was Countess of Carrick in her own right, as heir to her father, the Earl. Through his mother Robert became Earl in turn; through his father he inherited a claim on the Scottish throne as a descendant (albeit through a female line) of David I. He was born in 1274, and was therefore well aware of the kerfuffle when Edward I of England came north (with a sizeable army) to arbitrate the Scots succession after the death of Margaret, the Maid of Norway at the tender age of 6, uncrowned, but queen.
Edward awarded the crown to John Balliol, whom the Bruces considered to have a similar, but inferior, claim to their own. What Balliol did have, and the Bruces lacked, was a willingness to swear fealty to Edward and thereby reduce Scotland to the status of an English subordinate, much like a palatine county, granted its own government but obliged to pay taxes and supply armies and men whenever and however required.
Shortly thereafter Robert's grandfather surrendered his claim on the throne to his son, Robert's father (they were all called Robert, by the way), who in turn resigned the Carrick earldom to Robert. In 1295 Robert married. Isobel (or Isabella) was daughter to the Earl of Mar, but in the following year she died in childbed, their daughter Marjorie growing up to marry the High Steward of Scotland, and have a son of his, Robert, who would become Robert II.
In 1296, on the death of Balliol the Bruces, father and son, were obliged to swear fealty to Edward but when, in the following year, the Scots rose in revolt against the Guardian (governor) Edward had sent north, Robert refused orders to support the Governor, but instead led troops to harry and lay waste the Scots supporters of Edward. Compelled to make terms, Bruce was pardoned in return for his allegiance and his infant daughter as a hostage.
After the resignation, as Guardian, of William Wallace, Bruce became joint guardian with John Comyn (who also had his own claim to the throne). They failed to rise above their personal differences, even when the Bishop of St.Andrews was appointed as third co-Guardian in 1299. In 1300 Bruce resigned and was replaced; in 1301 all 3 joint Guardians resigned, and an Englishman was appointed, who immediately tried to negotiate the return of Balliol. It may have been the threat of the return of Balliol that led Bruce and others, in 1302, to submit to Edward, thereby preserving what they had against the time of Edward's death.