A castle is much more than a very large house. Sometimes as many as 50 people live there. Not because it was cheap or for fun because they could all defend themselves well. To be considered important you had to have a castle and if you didn't have that much money you first built a residential tower, the keep and later the rest.
Castle lords always learned new things. They found that a square castle was easier to defend than a round castle. Round castles are mission easier to make but you can't see around a bend. Later they built round towers on the corners slightly outwards, because then the view was even better. A castle should be as difficult as possible for the enemy to take. High walls made it difficult to climb even with a specially made equal height. The walls were thick, you couldn't get through them easily even with the heavy bullets of the glad one. Because of the narrow embrasures you could easily shoot from the inside out, but the other way around it was very difficult. There was also only one entrance, a gate that you could secure extra with a beacon and sometimes there was a portcullis behind it. When the enemy was in the courtyard, the lord of the castle dropped the portcullis and the enemy was trapped. The castle was surrounded by a moat and a drawbridge that was raised in a siege. The enemy besieged the castle. They just wait outside until there was no more food or drink inside. That starvation was arousing, but it could sometimes last a very long time. In the attic of the castles there is always enough food to last a few weeks. To fool the enemy they left a pig alive to the last, because all the enemy the pig hoode he thought there was still enough food. The besiegers went home when the siege got too long or all the crop had to be taken from the land.
In the wars of that time, the knights first wore chain mail in which you could move well. But better and better weapons and arrows came through the rings. You couldn't get through the later armor, but those iron plates were not really comfortable and you also got terribly hot. A knight in armor became a kind of living tank to be hoisted on his horse.
The lord of the manor, usually a knight, was in charge of the entire castle and of everyone who lived on his land around the castle. Land was important because such a job as a knight did not include a salary and the land could be lent to the peasants, who paid it in return with part of the proceeds of the harvest. Sometimes also curfews.
Knights needed a lot of money to fight tee. If you won you could loot the castle from a vein. That was not always the case. As a knight you had to take good care of your people and sometimes play judge. Criminals were locked up in the castle.