Strangely for the firstborn child of a king, Margaret was not born in her father's kingdom. Instead, she was born within the borders of Scotland's frequent enemy among the bosom of her mother's family, the English royal family. Margaret's parents, Alexander III of Scotland and Margaret of England had been visiting the royal in-laws when Margaret realized she was pregnant. Unhappy in Scotland and perhaps desperate to be near her own very loving mother, she begged to be left behind when Alexander returned home. He agreed, but only after making his father-in-law formally swear that he would not hold on to the newborn Scottish heir or his queen.
Mother Margaret and baby Margaret finally returned to Scotland a few months after the birth. A son and heir arrived son thereafter and another son many years after that. Not long after that, the youngsters lost their beloved mother. Young Margaret was not yet 14. She had undoubtedly grown up knowing that, like her mother, she would be forced to leave home one day to make a political marriage; the continual war with Norway made it clear which direction her fate would follow. However, she may not have been too keen, at the age of 20 to be married off to a 13-year-old boy, King Eric II of Norway. Nevertheless, she put a good face on things, writing to her uncle the new King Edward I of England, that she was happy and healthy.
Margaret was well-received in Norway. Despite her husband's extreme youth, she became pregnant. Early in 1283, she gave birth to a baby girl, named Margaret (just to make things even more confusing for future royal bloggers and their readers). Soon after, Margaret of Scotland died. Back in Scotland, things were not going well for her family. Her youngest brother had died years earlier. When her only other brother died less than a year after her, their father had no children to succeed him. He named his only grandchild, the infant Margaret, called "The Maid of Norway," as his heir. She inherited the Scottish throne when she was three years old.
For more about Margaret:
Margaret of Scotland, Queen of Norway on Edward the Second