Why were pyramids built?

The only true pyramids ever built were in Egypt where they were burial places of the ancient rulers of Egypt, the Pharaohs. They are square in plan, with triangular sides sloping to meet each other at an apex. The three pyramids at Giza are the largest and finest of their kind. The Great Pyramid of Khufu or Cheops at Giza, built around 2650 BC, is the largest and one of the Seven Wonders of the World. It is a solid mass of limestone blocks covering 5.3 hectares. Originally it was 147 meters high and took twenty years to build.
The entrance to the pyramid is in the northern wall and a small passage leads through various other chambers to the burial chamber itself deep within the pyramid.
Pyramid-like structures, not true pyramids, were also built by the ancient Mesopotamians and the Mayas in Central America and Mexico.

(Taken from Bahasa Inggris, Materi PTBK Buku 2)