Ive heard the possibly apocryphal reason for this is that invading armies would kill or appropriate workers in other professions but keep around the trained blacksmiths working the forge and producing weapons and tools for war. Smiths survived the waves of conquerors.
There were technically invasion attempts up until the 18th century, but even discarding most of those as insignificant, we can hardly neglect the War of the Roses and Henry Tudor's (successful) invasion in 1485...