A pyramid is a square version of a cone. Pour sand in one spot and you get a cone. It is naturally stable. This fact was not lost on ancient man. a pyramid is simply a more perfect version of a cone where the pile of stones are stable and will not topple.
Ok. Makes sense but who and why were the huge figures made? I have seen explanations but did not like them. When I was a teen, I remember reading a Hardy Boys book that was about them but that was many decades ago. : ) I think it was about them.