I minored in Egyptology in college and how the pyramids were built is one of the things that fascinated me the most. As with most building projects in ancient Egypt, they had a ritual tool burial when it was completed, where they buried examples of the tools they used, under the foundation. The tools found in the case of the pyramids were neolithic stone tools mostly.
Also, the builders were not slaves, they were professional pyramid builders, (paid) and even got retirement pensions and the right to be buried in a special necropolis near the pyramid they helped build.
As to the question of how they got the stones into place, among the tools found in the ritual tool burial was a wooden "rocker". It was based on the same principle that makes a rocking chair slide across the floor when you rock in it. They put the stone on the rocker then rocked/slid it into place then pulled the rocker out from under it. (This of course was done after they got the stone up to the location they wanted to put it into. How they got it up there in the first place is still a mystery for which nobody has a satisfactory explanation.
In summary, they were built by humans at the close of the Neolithic age and represent the ultimate in stone-age acomplishment