Archaeologists divide ancient Egypt's history into three big blocks of time. In each block of time, all pharaohs behaved in a certain way. These blocks of time were called kingdoms. Scientists named these blocks the Old Kingdom, the Middle Kingdom, and the New Kingdom.
During the time of the Old Kingdom, pharaohs were buried in pyramids. It was time consuming to build a pyramid. It was expensive to build a pyramid. It was hard to hide a pyramid. These were all problems.
All the ancient Egyptians made grave goods. They made little clay figures to do their work for them in their afterlife, and all kinds of little miniature things that would magically grow to whatever size they needed. Grave goods were made to be buried with them in their tombs. They did not want to be robbed of their comfort in their afterlife.
Pharaohs also wanted their grave goods to stay buried with them. But Pharaohs' grave goods were treasures. Men were hired to guard the pyramid. The guards lived in a "pyramid city", located at the base of pyramid. Most guards had families with them. All of these people had to be fed and sheltered and clothed. That's how the guards were paid. That added more expense.
Pyramids turned out to be a great deal of trouble and expense. Pyramids went out of style.
During the time of the Middle Kingdom, pharaohs were buried in hidden tombs all over the place. The Egyptian tomb builders did a wonderful job hiding the tombs. Archaeologist know what pharaohs ruled during this time period. The ancient Egyptians believed if you didn't have your name written down somewhere, you would disappear from your afterlife. Everybody wanted to enjoy their afterlife, so Pharaohs' had their name written down and chiseled everywhere. Archaeologists still have not found all the tombs.
During the time of the New Kingdom, pharaohs were all buried in hidden tombs in the same geographical area. Archaeologists call this area the Valley of the Kings. This was a compromise for the ancient Egyptians. It was during this time period in history that Egypt became a world power in the ancient world.