Castles were once built for economic and strategic reasons in order to secure a sphere of influence. They began to lose their military importance in the middle of the 15th century as more and more cannons were employed in war. Grand new architectures came into play for the design of castles.
In the post-medieval period representative palaces were built in the cities and countryside as residences for the overlords of territorial states. They gradually lost their function as defensive bulwarks.
Fortresses took over the military role of the castle. Advances in artillery and siege technique called for new forms of defensive architecture. Lower, more massive ramparts absorbed the impact of the artillery and kept the adversary at a distance. Star-shaped bastions helped to avoid blind angles. At the same time it was important to prevent the invaders from setting up scaling ladders or using explosive charges from the ditch. Sometimes castles were rebuilt into fortresses. Fortress construction was expensive, however, and severely strained the finances of the early modern princely states.