It all began in 933 AD when the Channel Islands became part of the Norman Realm. In 1066, the Duke of Normandy landed his army in Sussex and became William I of England. The Channel Islands, however, remained part of the Duchy of Normandy and continued to be governed as such.
When Continental Normandy was lost in 1204 the Channel Islands remained loyal to the King of England as the King promised to rule the islands as though he was the Duke of Normandy (i.e. observing the Duchy's laws, customs and liberties). This arrangement has been confirmed in charters of successive sovereigns that have secured for the islands their own judiciaries and freedom from the process of the English Courts. Indeed the Islands are independent in all matters with the exception of international representation and defence for which the United Kingdom is responsible.
The islands were the focal point of strife between England and France for many years due to their allegiance to England. At times, the French raided the islands and gained temporary footholds and, as a consequence, there are castles and fortresses around Guernsey that were originally built as a protection against invaders.