We may think of castles as British, but they were imported from Europe with the Normans. This was because Europe was split up into a huge number of tiny kingdoms.
Each kingdom was run by a war lord who was not interested in looking after the peasants who worked for him. He was interested in looking after himself.
So European lords did not build forts for the whole village, but personal fortified homes castles.