I was surprised too when I visited Cairo and Giza .. The Sphinx and Pyramids are right next to all kinds of community, etc..
I was in Cairo, and my hotel overlooked the pyramids. Yes, close to ‘civilization’. And on a clear day we could see the pyramids at Saqqara (Memphis).
Contrary to popular thought/conception, the Step Pyramid at Saqqara was not the first pyramid. The pyramids at Giza predate it. The Step Pyramid at Memphis was an attempt to copy the pyramids at Giza.