There's some speculation that the Pyramids were a kind of jobs program - the proverbial Keynesian "paying people to dig holes and fill them up again" trick to a perpetual growth economy - that gave Egypt a degree of stability and developed culture not seen outside the region for centuries.
The original Pharaohs came to power as a religiously-themed accounting/insurance bureaucracy. They administered the stockpiles of reserve grain after the harvest and paid it back out again during the growing season. But in traditional corrupt bureaucratic fashion, leveraged their control over the information of who was owed what and how much to accrue wealth to themselves. Then they started leveraging their newfound wealth to commission large arts projects - palaces and sculptures and such - as the population grew larger and more sophisticated. Finally, they were mobilizing tens of thousands of artisans and laborers to build these super massive tombs. The system worked for thousands of years, until they were colonized by neighboring territories with even more advanced technology and sophisticated bureaucracy.
But the idea that it was just a big guy with a whip hitting a bunch of smaller guys misses how these large theocratic governments functioned in practice. The real power of the throne was the ability to read and write, to know how much agricultural surplus the country had accrued in prior years, and to cultivate favors through the timely repayment of debts. The accounting system gave people a sense of equity and reliability, which became a means of justifying violence when it was periodically doled out. Faith in the system was so high that its administrative leadership was considered god-like, via their ability to successfully manage a large population of agricultural workers so successfully.
It wasn't violence that compelled people to build the pyramids. It was trust in the reliability of a large and efficient bureaucracy.
Plus...a worker's village excavated on the Giza plateau contained large rows of bakeries, evidence that the workers ate meat, fish and vegetables, had extraordinarily good healthcare (evidence of life saving amputations and setting of broken bones, etc).
Imagine you're an individual young man in ancient Egypt, and it word comes around that the king is building the world's biggest triangle or whatever, and they need help moving the giant stone blocks. Any young men who volunteer will be fed lots of great food and beer. They're recruiting young women in the tens of thousands to work in the kitchens, bakeries and breweries.
"Hey I think I'm going to Giza to check out this big triangle thing."