It depends on your goals -- Videotoolbox (using Apple's hardware encoder) will encode by far the fastest. Software encoding on the CPU will generate smaller files for a given level of visual quality but will take multiple times longer.
At two extremes of use cases, people almost always use Videotoolbox when they want real-time encoding while people tend to use software/CPU encoding for archival purposes (or similarly creating files that will be saved for distribution to a lot of people).
Three additional notes:
-You didn't mention your hardware but Apple Silicon and the T2 chips share a similar media engine -- the ones in the Apple Silicon of course being a newer generation that are both faster and can handle newer media types (e.g. 10-bit HEVC for HDR)
-All else being equal you will probably want to use a relatively higher quality target setting when using hardware encoding (e.g. Videotoolbox) and will need to test different encoding parameters to find the quality/output size/encoding time tradeoff you want
-The relative tradeoffs vary between generations of hardware and so you need to check your assumptions/preferred parameters after major hardware upgrades