There has been detailed archaeological work done in recent years on the lives of ordinary Egyptians, as well as ancient Egyptian social structure. Slaves were not employed in the building of the pyramids. This idea was popularized by Hollywood movies. They were paid, and there was a large infrastructure of rotating workers, made up of labourers, engineers, scribes, painters, etc. They found evidence of long dormitory type houses where the workers stayed, supported by rows of bakers and brewers. The work was incredibly hard and dangerous, as evidenced by the wear and tear we can see in the bones.
The first known recorded strike in human history took place during the reign of Rameses lll. The payment of grain was late.
This is off topic, but the building of the vanity projects in Egypt did provide paid work, as well as support for secondary businesses such as bakers, painters, brewers, and supposedly tool makers. So, there is a little similarity to the positive effects NASA has on the economy. Okay, it's mostly a side topic.