Edward I, as many kings of England before him, wanted Wales under his control. His father Henry III had already invaded Wales several times, but the Welsh continued their stubborn, fierce resistance. Edward came up with a plan to conquer and secure Wales by building a series of castles along with his military campaigns.
Edward's chief architect for these castles was James of St. George who was brought in from France. James' designs were very innovative, conforming to the terrain available and new defensive strategies. The main feature of his castles was their concentric design. Each ring of walls was shorter than the one before it so that arrows and other projectiles could be fired at a certain point by an increased number of defenders. Towers were also an important part of James' designs. He devised better arrow slits for them, as well as machicolations (gaps for pouring liquids), anchor points for hoardings (wooden structures built around the top of a tower or wall), and placed round towers to create gatehouses (with nasty ways to deter enemies as well). These new castles created a whole new genre in European caslte-building named Edwardian, after their financier.
Unfortunately for Edward, these castles were massively expensive to build, often requiring thousands of laborers and skilled workers as well as huge amounts of material resources. Supposedly, Edward emptied all the churches in England of silver to pay for the castles. It cost more than 10 times Edward's annual income to finish the castles at Conwy, Caernarvon, and Beaumaris, not to mention the troops he sent to Wales and his many other building and refurbishing projects.
Edward I issued the Statute of Rhuddlan in 1284, placing northern Wales directly under English control. Royal courts were established at Caernarvon, and Edward's son, Edward II, was born there. Ever since, every English king except Edward II has given the title Prince of Wales to his heir.