For the ancient Egyptians, pharaohs were the physical embodiment of the gods Horus (god of sky, war and protection) and Osiris (god of the afterlife, the underworld and the dead). When they died, it was important that they be protected, and pyramids were created accordingly.
I'm not sure if it answered your question or not but I hope it helped