Final answer:
The purpose of castles transformed from residential fortresses to vulnerable targets and then to improved military fortifications due to advances in artillery, affecting social and political power structures.
Step-by-step explanation:
The purpose of castles underwent significant changes during different historical periods. Initially, castles served as fortified residences for nobility, providing defense against invaders and symbolizing feudal power. As military technology advanced, particularly with the introduction of cannon and gunpowder, castles evolved from their primary defensive role to targets that could be destroyed by powerful artillery. The design of military fortifications had to adapt, leading to star-shaped fortresses that could resist cannon fire and allow for guns to be aimed in all directions. Moreover, these changes in warfare affected societies on various levels, from taxing peasants for military expenditures to reshaping the power dynamics between rulers and the nobility.