The pyramids were built to protect the bodies of the pharaohs. They contained a burial chamber and then numerous false tunnels, false doors, and even a false burial chamber to throw off grave robbers. Several light shafts, lining up with star positions in the sky, were also made. Now, all of this had to do with the very strict and superstitious religious system of the Ancient Egyptians; they believed this life was not nearly as important as the next life; that when you died, your soul (called the "Ba") would leave your body, but after a while, both the Ba and Ka (your soul and "essence") would return to live in your body in the afterlife. For this reason, the Ancient Egyptians believed that the body had to be kept perfectly intact after death. So, they created an elaborate process of embalming to preserve the bodies of the pharaohs (among other people buried with them): mummification. Here's how it works:
First the internal organs are taken out and mummified individually. Because Egyptians believed the soul came from the heart, the brain was not necessary for the afterlife. It was removed through the nose. These organs are then put into Canopic jars to accompany the body. The jars (naturally) were decorated and even carved to resemble the figures of some of the different gods. The baboon-headed Hapy guarded the lungs; the human-headed Imsety, the liver; the jackal-headed Duamutef, the stomach and upper intestines; the falcon-headed Qebehsenuef, the lower intestines; …and so on. These jars were believed to be necessary for the soul's rebirth ('cause you need organs, and that's just how it is). An opening of the mouth ceremony is performed on the mummy so that the Ka had a place to enter the body. (The pharaoh's body would provide a home for the Ka in the afterlife). Then the body is anointed with oil and wrapped in strip bandages. It is placed in a Sarcophagus (a stone coffin) and then all sealed up. The stone coffins were often carved in the deceased's likeness—in case the body was damaged, the Ka would have somewhere else to live.