I have no knowledge of their internal setup, but I suspect they have a big room full of racked ESX servers (non-Apple hardware) running builds on macOS VMs. And probably a ton of networked iPhone motherboards running automated tests.
I just wish they would make that kind of setup (macOS VMs on non-Apple hardware) legal for other developers.