I'm not a fan of Apple but indeed in theory it is said to have more privacy, or at least more resistance towards government interference. Apple's ecosystem of apps is also more closed and the vetting process to select which apps are allowed on the store is stronger. This should give them a bit of an edge security wise. On the other hand I always prefer Android when it comes to software diversity, features and customisation.
As for the hardware specs, especially when it comes to the CPU and GPU the iPhone is leading. The Apple silicon chips are really a game changer performance and battery usage wise. That said, this probably only really matters for gaming.