The keep and the auxiliary buildings that supported castle life varied from castle to castle. Sometimes buildings (like the chapel, great hall and kitchens) were integrated into the keep, and sometimes they were separated.
The keep was the main residence of the ruling lord. It was made of stone and could be square or circular. Keeps could be attached to walls or freestanding. They had many functions.
Residential apartments contained beds and furnishings. They were usually heated by fireplaces, and light came through glass windows.
The great hall could be located in the keep or in separate buildings. In the earliest castles, like the one described in the epic poem "Beowulf," great halls were used for eating and sleeping. Later, they were used for entertaining and holding court. They usually had high ceilings and large fireplaces. The floors were usually stone or dirt.
Storage of food, beverages and gold was usually in the lower levels of the keep.
Defense (arrow loops, armory, battlements) usually occupied the top levels.
Prisoners were kept in the dungeon (derived from "donjon"). Dungeons were usually in the upper parts of the keep because it made escape more difficult, but they were later moved to the lower levels.
Religion was important in everyday life during the Middle Ages. People went to church every day, usually morning mass. Most castles had their own chapels and priests, either in-residence or visiting. Chapels could be simple rooms in the keep or elaborate separate buildings.
Horses were essential in medieval life. Knights rode them into battle. They pulled carts. They were transportation, like your car. So they needed a garage -- or stables, which were usually located in the bailey.
Because of the threat of fire, kitchens in early castles were separated from the keep in kitchen towers. As brick construction became more common, castle designers moved kitchens into the keep.
Wells and cisterns were collected water for the castle. Often, the ability to access freshwater was a key factor in whether a castle could withstand a siege. Wells could be located within the keep or in the bailey. Cisterns collected rainwater from the roofs. Some castles had rudimentary plumbing that channeled water from cisterns to sinks.
Castles needed many craftsmen and artisans, including carpenters, farriers and blacksmiths, to maintain the buildings and grounds. Their workshops were usually separate buildings within the bailey.