Depends which Egyptian kingdom you are talking about and which pyramids.
The time between the Old kingdom and cleopatra was over 3,000 years.
In fact, Cleopatra lives closer to us in time than the time the great pyramids were built. The Egyptians had archaeologists who studied ancient Egyptians.
In the middle, there were, indeed, various southern African kingdoms.