Following the discovery of the Americas in the late 15th century, the Canary Islands quickly became a major stopover for long, cross-Atlantic voyages. Ships loaded up with spices and treasures from the so-called "new world" would often set anchor off the islands' shores, giving the islands a whole new flavor as a bustling base for trade and exportation.
For these very reasons, the waters between the Canary and Azores Islands were essentially patrolled by pirate flotillas awaiting treasure-laden ships to prey upon. When they weren't setting their sights on the next ship, however, they often hit up the island shores in search of wine and riches and therefore putting these valuable towns at risk.
In order to defend villages and towns from pirate attacks and foreign enemy invasions, Spain launched a major fortification of the islands- all but Fuerteventura, which was deemed too flat and therefore indefensible. With the bulk of the construction taking place throughout the 16th and 17th centuries, Tenerife saw the erection of look-out towers, defensive walls and castles in coastal areas.
There was also some later fortification during the 19th century when Spain's American colonies began fighting for - and subsequently attaining - independence. Fearing that the newly liberated colonies would rally together and attack the Canary Islands, more castles and tower popped up around the islands, although in the end there was no attack.
In Tenerife, a few of the best lasting fortifications from this era are the Garachico, Santo Cristo de Paso Alto and San Andrés castles.