Since Crete became an "apple of discord" for the civilizations of the Mediterranean, the then occupants cared for its fortification
Crete in ancient times was not threatened by external enemies. The first external enemies of the island were the Romans. Therefore, till then, the fortification of cities was focused on internal enemies. After the Roman Empire (67 BC-330 AD) things changed radically. Crete became a province of the Eastern Roman Empire, which later transformed to the Byzantine Empire. At the same time, several civilizations started developing around the Mediterranean Sea.
Thus, Crete, because of its natural and geopolitical position, acquired great importance and became an "apple of discord" for the civilizations of the Mediterranean. During the First Byzantine Period (330-824) things looked calm. For that reason, combined with the internal and external problems of the Empire, the island was on the fringes of the Byzantine interest. Thus, pirate raids increased and the seaside monasteries were fortified to protect themselves.
Under these circumstances, the first storm on the island was imminent. The Saracen pirates managed to easily occupy Crete in 824, that was almost defenseless. They settled for 140 years, till 961, during which they fortified the largest town, today’s Heraklion. After continuous failures to reoccupy Crete, Nikiforos Fokas managed to free the island from pirates in 961. Then, the Byzantines built new walls, which managed to keep invaders away for a few more centuries.
In 1206, Crete passed into the hands of the Genoese, who immediately gave particular importance to the fortification of the island. Within a few years the fortified three castles and 12 fortresses, but still the Venetians managed to occupy the island in 1209. The Venetian Era in Crete lasted for 4.5 centuries and was mainly dependant on the colossal fortification structures. The best Venetian engineers built the Great Castle of Candia (Heraklion). The Turks managed to take over Candia in 1669 after 22 years (!) of besieging and immediately started restoring the Venetian Forts and built a lot of small fortresses across the Cretan Territory, called Koules. The Turks took care of their forts till the end of their presence on the island.
Even today, visitors can get an idea of what the fortified cities of Crete were like, as the walls are still in excellent condition. The impressive castles in Chania, Rethymnon and Heraklion and the fortresses on the islands of Souda, Gramvousa, Spinalonga are but a few samples of Cretan fort architecture.