Smartphones lack nearly all of the kinds of IO interfaces supported by a Raspberry Pi.
You can even easily interface any Arduino for additional GPIOs via OTG and USB.
iPhone 12
Apple A14 Bionic @ 2.99 GHz
1 Processor, 6 Cores
5.60 GB
Raspberry Pi 4
ARM BCM2711 @ 1.50 GHz
1 Processor, 4 Cores
1.77 GB
I think iPhone always outperforms Raspberry Pi: https://browser.geekbench.com/v5/cpu/compare/4581331?baselin...Which makes sense since it was $1000 and the Pi was $35.