Why Were Castles Built?

Castles were built because they were easily defensible. It was good in those times to have a place where a whole village could be housed for protection purposes, as there were often raiders and wars sweeping the countryside.