Edward had his eyes on Wales for thirty years, ever since Llywelyn ap Gruffydd’s forces had swept through his lands (held custodially by Edward’s parents and guardians) in 1256. (see my post: https://sarahwoodbury.com/the-rising-of-1256/) Llywelyn’s army marched all the way to Deheubarth that summer and fall, and set the stage of Llywelyn’s twenty year supremacy in Wales. However, it wasn’t until 1267 that Edward’s father, Henry III, acknowledged Llywelyn as the Prince of Wales, a title he inherited from his grandfather–and another ten years after that before things fell apart for the Welsh prince. http://www.castlewales.com/llywel2.html
Edward participated in the Ninth Crusade (see my post: https://sarahwoodbury.com/the-ninth-crusade/) and despite the fact that his father died in 1272, he didn’t return to England until 1274, at which point he immediately turned a covetous eye on Wales. Why Wales instead of Scotland? It seems likely that Wales looked the easier target. Scotland had always been a separate kingdom, whereas Wales had fallen under the jurisdiction of England as a principality since the turn of the 13th century. Thus, invading Scotland meant attacking the rule of a reigning monarch; attacking Wales meant reining in a rebellious prince–a different matter entirely. In addition, in the winter of 1274, Dafydd ap Gruffydd, Llywelyn’s brother, conspired to assassinate Llywelyn and only a sudden snowstorm averted the attack. Dafydd, a long time friend of Edward from childhood, fled to England, and to Edward. Perhaps Edward believed if he unseated Llywelyn, he’d have a malleable prince in Dafydd.
For Scotland’s part, when King Alexander III of Scotland married Margaret of England in 1251 (Henry III’s daughter), Henry had tried to insist that Alexander give homage to him. Alexander refused. By 1261, at the age of 21, Alexander was well on his way to having as grand a plans for Scotland as Llywelyn had for Wales. He maintained a firm grip on power until his death in 1286. http://www.rampantscotland.com/famous/blfamalexander3.htm
By then, Llywelyn had been murdered (in 1282) and Wales had fallen finally, and permanently, to Edward. Subsequently, in 1283, Edward hanged, drew, and quartered Dafydd, the first man of standing to die such a heinous death. Edward inflicted the same death on William Wallace in 1305.
With King Alexander’s death, Edward saw Scotland as ripe for picking. With no obvious heir (all of Alexander’s children had died by 1284), only a granddaughter, Margaret, remained. When she died in 1290, upwards of fourteen different magnates claimed the throne, and they turned to Edward to arbitrate the dispute. He, of course, wanted whoever was crowned to swear allegiance to him. They all refused and eventually John Balloil was appointed king. Still, Edward maintained that he was the rightful overlord–and when he demanded the Scots join him in a war against France, the Scots instead allied with France. Unfortunately, this gave Edward the excuse he needed to invade Scotland, which he did in 1296. (see my post: https://sarahwoodbury.com/the-succession-of-1290-scotland/)