...The Mac Pro cylinders' Xeon chips don't have Quick Sync so all the encoding is done by the CPU, which is significantly slower at the job. Move up to two pass encoding and the Mac Pro will win the race, but most people stick to single pass because it's quicker.
https://larryjordan.com/articles/mac-pro-video-compression/
The information in that article is dated and no longer correct. The 2015 i7 iMac 27 encodes to single-pass H264 about 1.9x faster than a 12-core D700 Mac Pro. FCPX 10.3.4 in two-pass "Better Quality" mode is about 1.8x slower than single-pass, so even the 2015 iMac in two-pass mode was faster than the 12-core nMP.
The 2017 iMac 27 is about 2x faster than the 2015 model at H264 encode/decode, apparently due to Kaby Lake Quick Sync improvements. In rough terms it is nearly 4x faster than the 12-core nMP on this workload in single-pass mode, and roughly 2x faster in two-pass mode.
It is also much faster on the H264 *decode* side, not just encoding. A very common workflow is transcoding H264 to ProRes proxy, which is mainly a decode task since ProRes encoding is less CPU intensive than H264. In this case there is no single pass vs two-pass decision: the algorithm is the same.
On H264 to ProRes proxy transcoding, I recently tested a 12-core D700 Mac Pro vs a 2017 i7 iMac 27 using FCPX and the iMac was consistently about 3.5x faster on this task.