Nobody's right sure, but on a timescale of about 500 - 800 years the practice changed like so: pyramidscomprised a mortuary temple built next to a big pile of rock with a burial shaft under it. The fashion evolved into building a mortuary temple to honour the deceased with a burial shaft underneath it, and then into the practice of building separate mortuary temples on the nile floodplain with a hiddenshaft-tomb in the cliffs of the hinterland.
For my own part, I think the penny sort of dropped. You make a huge monument, stuff it with gold and jewels, and tell people they must never touch it. Hmmm. I bet most of it spent less than 24 hours with dead pharaoh before being recycled down the souk. None of the treasure survived inside huge structures such as the Great Pyramid and it is no coincidence that Tutankhamen's tomb survived intact because it was hidden away and forgotten.