Earlier I discussed the development of castles. Here I want to discuss one of the earliest versions from the eleventh century, the motte-and-bailey castle. (They were not called this in the eleventh century when they were invented. They were just called castles. But modern historians of architecture like the term because it's descriptive and because it distinguishes this type of castle from other, later types.)
Let's start with the motte. The term means a mound. (It does not mean a moat, and in fact most real castles did not have the circle of water with swans swimming in it that one sees in modern fairy-tale books--not even a moat without the swans.)
A castle was of course most defensible if built on a high place, and an artificial mound increased the height. There is some discussion whether a mound was built first and the keep that was the heart of a castle built on top of that, or, as seems more likely, the keep (tower) was built first, grounded on bedrock, and then a mound was built up around it. A wall was often built all the way around the base of the motte, providing additional protection for the tower.
In any event, the lower, underground levels of the tower were used for storage, the ground level had no windows or doors, and the first door was one level up. This required a wooden staircase on the outside, which could easily be taken in or fired in case of attack. Only the upper levels had decent windows.
In the above image, the tower dates from the twelfth century, not the eleventh, but you can see the typical position of the one door, well above ground level.
The bailey was an open area, inside a wall, where buildings were run up to serve the needs of the castle: barracks, kitchens, more storerooms, weapons shops, mews (for the hawks), stables, and the like. Originally the wall encircling the bailey would have been built of wooden posts, more like a stockade than anything, but soon the wood was replaced with stone.
What architectural historians consider the "normal" motte-and-bailey arrangement consisted of two sets of circular walls, essentially looking from above like a figure-8, with the motte in one and the bailey in the other, the two joined in the center. But as already noted, every castle was different, and the typical arrangement was soon to have a wide, open area at the base of the motte, where all the incidental buildings were built, and a high stone wall encircling it all.
The castle of Gisors seen above, built at the end of the eleventh century, has its central keep on top of a very large mound, a wall around it, and more walls at the base of the mound and beyond it.