Where did the builders of the pyramids get their knowledge?
Their knowledge was real science, not magic. God allowed some ancient peoples to rise further in certain fields than we think possible today, and that should keep us from pride in our own knowledge.
Anyone standing before the pyramids has good reason to be amazed. Every one of the heavy stones sits exactly in its place. The angles hardly deviate, and the alignment towards the north is the same for every stone. Even with modern equipment such precision would be very hard to achieve, and today's architects admit as much.
This was not magic. It was science. With that knowledge the builders also understood the positions and movements of the heavenly bodies. Yet this knowledge has been lost. It survives in no book and in no formula that has come down to us. But what it produced still stands before our eyes.
The Holy Qur’an speaks to exactly this experience. In effect it asks people whether they think themselves great because of their buildings, and it reminds them of nations before them who could build better. At first this seems strange, because our technology as a whole is far more advanced. But the Holy Qur’an is not comparing everything. It speaks of particular fields in which ancient peoples shot up like meteors and left us wondering to this day.
The lesson is simple. God allowed some peoples to rise in certain fields far beyond what we can imagine. Whoever thinks that their own age knows better than every age before it is mistaken. Pride in our own skill is arrogance. The pyramids invite humility instead, and the question of how much we still do not know.