Both are great systems. Which is preferable tends to depend on the Use case.
I use both, just like I use windows/Linux/Mac OS dependent on the task.
the iPhone is a superb piece of hardware, generally let down by the lack of easy repairability and in modern generations, apples insistence to tie things like the battery and the screen to that particular phone. It is a devious and unconscionable act for those who can repair things itself.
the operating system is also brilliant, but highly limited in allowing the user to do particular tasks/customisations and run anything that Apple doesn’t validate.
it is the safer operating system for non technical users. And in general, Apple supports the hardware much longer in terms of Os updates.
android phones generally allow you to configure them and customise them much more, and do certain tasks that the iPhone /iOS combination just doesn’t allow.
unfortunately in recent years most manufacturers have also gone down apples path of making the devices very difficult to repair.
overall - horses for courses. I like both but my primary phone is an iPhone because there is no substitute for GarageBands brilliance.