> not sure why the attach rpi for every mac mini, wouldn't it be cheaper to have one rpi and 9 mac minis connectd to 10 port switch?
Simple... they're (likely) running something on the Raspberry Pi's that sets them up as USB gadgets, aka the Mac Mini "sees" a virtual keyboard and mouse. That's enough to manage remote provisioning.
To replicate that they'd need a KVM switch which doesn't have some weird edge case in how exactly it does USB-C switching, and it needs to be remotely controlled. A Pi is cheaper plus the failure modes of a Pi are more understood than the failure mode of some weird ass KVM switch someone cobbled together in China.