IIRC correctly from a History Channel program on it, the pyramid form developed from ancient burial techniques. Early Egyptian rulers had a square or rectangular bunker built over their tombs. Then one self-important one had a smaller, symetrical layer added on top so his would look taller. Successive rulers added to that idea. The earlier large pyramids looked a lot like the Mexican-culture stepped ones.
The pyramids we recognize today are they result of the evolution of that technique with the "step" parts filled in to make it a smooth slope.
Commonly referred to as the "Ziggurat".. An advanced form of step-pyramid..
This form was also common in ancient Babylon / Sumeria / Assyria..