What good could the pyramids of Egypt serve?
When one is interested in these strange monuments, one must immediately ask the question of the role they had. One of the first answers that comes naturally is that these are tombs. And that's just right, it's as simple as that.
The three pyramids of Giza
Originally, a religious question
During the ancient empire the people lived with a spiritual concept much more important than what we know nowadays, even from what we can imagine: Religion was pregnant in the society of ancient Egypt, and its precepts were followed faithfully.
One of the principles was that the Sun, bringing life, left the world of the living every night before reappearing in the morning. If we think that the ancient Egyptians did not know if the Sun would really get up in the morning, if one day, a superior entity was not going to make sure that it does not come back anymore, we can imagine the seriousness that he was trying to satisfy this unknown entity.
Over time names were given to these entities, we speak of God, and at the beginning of the Third Dynasty the cult of Re (or Ra) was developed, with a whole imaginary around death. It was imagined that there was a primordial ocean, the source of everything, and the rivers that led to it. It was imagined that when something was created, when a birth happened, a part of that ocean was taken. Of course, the disappearance of this living being, his share of life returned to the ocean. But for that, it was necessary to be able to go there, and the only one to be able to direct the "souls" towards the primordial ocean was the pharaoh, by definition of divine essence.
The need for a funeral complex
It was therefore important that the pharaoh, at his death, could return to the ocean, if only to guide his deceased population to do so. And what better than to prepare this jump in the world of the dead than to make a tomb with all the helpers for this passage?
The pyramid is the ultimate tomb of the Pharaoh, it is only part of a funerary complex much larger than what we think of today, and of which there are still, often traces. But as many of the buildings attached to a funeral complex have disappeared, it is hard to imagine a tomb as a whole. That of Khafra is among the best preserved.
The pyramid is just the tomb. The Pharaoh, when he died, was transported by boat to a temple, called "temple of the valley". He was mummified there, then transported to a "high temple", a temple attached to the pyramid. Here, rites were performed before the body was transported to the burial chamber. The complex was often endowed with "chapels", "ancillary buildings" and places of life for the priests who remained in the service of the dead pharaoh, in charge for them to please the God by making the necessary daily rites.
The assignment of priests
Many priests were assigned to these post-mortem tasks. The more priests a pharaoh had after him, the greater his power. One of the most revered was Khufu, who had 10 priests when he died, and 60 a few decades later. His worship disappeared with time, but it reappeared during the new empire, 2000 later, Khufu was then considered a God.
Some pharaohs had few priests, and for a short time. The more time passed, the less priests were assigned to some, there was also a kind of fashion effects, prioritizing certain cults and not others. Thus the total number of priests assigned to the deceased pharaohs could vary greatly from one period to another. But the constancy of this cult is proven, which confirms the divine nature of the pharaohs in the imagination of the Egyptians of the old empire.