Kings and Nobles spent much time and effort defending their land from attacks. So this is why they would build castles on it.
The first types of castles built in Medieval times were motte and bailey castles. A hill was built called the motte. A big tower was on top of this called a keep. Then the area all below this was the bailey.
Wooden castles could easily be destroyed by fire, so therefore many nobles built stone castles. These castles were more expensive
The keep was where the noble and his wife lived. Their servants and soldiers also had their quarters there. The walls of the keep were 3 - 6 metres thick.
The courtyard of the castle is surrounded by curtain walls. These were stone walls that were about 15 metres tall. Along the top of the wall were ramparts.
On Top of the curtain walls and keep was a watch tower called a turret, this allowed soldiers to watch for enemies.
Around the walls of the castle a moat was dug which was then filled with water. A drawbridge from the gatehouse was raised and lowered using chains.
Behind the drawbridge was a heavy iron gate called a portcullis which was used to block the entrance of the castle.
The latrines were holes in the side of the outer walls. Any waste was thrown out of it into the moat.
In the courtyard was were most of the craftsmen would work. The blacksmiths, carpenters and masons would all have workshops here. In the courtyard were also kitchens, stables for horses and a well.