The Pyramids were built as tombs for the Pharaohs, the rulers of Egypt. They were all built during the Old Kingdom, so that the greatest remains of Ancient Egypt are also some of the earliest to have been built!
The first Pharaohs built simpler tombs, called mastabas. These mastabas were square buildings with a room inside for the coffin and the mummy and some things to take with you to the afterlife.
step pyramid
Then the Egyptian pharaohs began to build mounds of earth on top of their mastabas, to make them grander. Ordinary princes and other aristocrats went on being buried in mastabas. The Step Pyramid is one of the first of these new fancy tombs. Doesn't it look a lot like a ziggurat?
bent pyramid
Soon the Egyptians decided to fill in the steps of the pyramid
pyramids
The first really pointed pyramids were built at Giza. Khufu's Great Pyramid (shown here) was the tallest building on earth for almost five thousand years, until the Eiffel Tower was built in 1889.
People often wonder how the Egyptians could build such huge buildings so long ago. But really a pyramid is not hard to build, if you have plenty of cheap workers available. First they built a small mastaba-style tomb on the ground, in the ordinary way. Then one theory is that they heaped up tons and tons of dirt over the tomb, leaving a tunnel to the outside. Then they began placing huge stones all over the outside of the pyramid. To raise the stones to the top of the pyramid, they built long ramps of dirt and then rolled the stones up them. They kept making the ramps higher and longer. When it was done, they took the earth ramps away again.