The main reasons iPhone or iPhone X more specifically has advantages over Android Flagships (obviously personal opinion) :
1. Display: No display come close to the X. S8 is closest one but it has that garish saturation which I am not a fan of as I want color accuracy. Even Pixel had the same color accuracy but with backlash from Android users. they had to include the saturation. Color accuracy is absolutely phenomenal on the iPhones. True-tone is amazing and makes the display consistent with different lighting conditions. Pixel 2 XL uses LG display and it shows as it not great compared to S8 or X
2. Performance: A11, as everyone mentioned, is absolutely beast and Android phones cannot even come close. It makes a huge difference as they design their own chips. Real-world Performance implications:
Only iPhone right now can record 4k 60FPS videos and no other android can do it right now. Also read this quote:
"We edited and exported the same 2-minute 4K video clip on the iPhone 8, Galaxy Note 8 and Galaxy S8 using the Adobe Premiere Clip app, and it wasn’t even close. The iPhone 8 finished the task in 42 seconds, compared with more than 3 minutes for the Galaxy Note 8 and more than 4 minutes for the Galaxy S8"
3. Design: Design is amazing on the X with end to end display almost except the notch (which am not sure how can you avoid without advancement in tech). Chrome edges and glass back (may make it brittle) makes it beautiful to look at and hold. (Also as an aside I have dropped it twice on hardwood floor with no visible and any internal damage). It is super pleasant to look at and use and actually feels nice. S8 is again the only one that comes close with Pixel 2 Xdoesn't feel as premium as these two.
4. FaceID: My experience with FaceID has been awesome. I don't need to touch things/perform a separate action to check my bank account, email or buy apps. It learns and I can open it while laying down in bed with or without glasses ..best experience Hey Siri with the phone locked and it opens everything automagically to perform this action. Also like little things like alarms being dimmed if you are looking at it.
5. Camera: Camera is debatable and I agree that Pixel 2 takes better pictures when it comes to certain conditions but overall iPhone X takes better pictures in different scenarios. Verge admitted to this when did a shootout for best camera smartphone even though they gave it Pixel 2 XL. and In video, iPhone kills it and there is no competition there. 3rd party Apps on iOS can make a huge difference and can give you lead over Android camera.
6. Other things: Haptic feedback. If you have used iPhone haptic feedback, you cannot go back..miles ahead of other phones. Bluetooth/ Carrier settings- I have used Android before (nexus series) and even my friends with their S8 complain about Bluetooth not working properly or voicemail not working or lack of visual voicemail on Android. These things may not be an issue for other people but support for iPhone is much better overall in this regard.
Standby battery is so much better on iPhone. (debatable by some but multiple sources points to this)
Cool attention to details Apple pays when making their phones: Try comparing the sound when you are listening to your iPhone between landscape or portrait and you will be able to make out the difference because it switches sound channel based on your orientation. I wish other manufacturers pay this much attention while making hardware as Apple.
Software and security: Apple does a better job of having more secure OS mainly due to their processes. Apps are better vetted and you get security updates. Pixel can give you security updates but Apps are still an issue especially they either demand too much permissions or are outright malware. (Google is making good progress here and hopefully will make it as secure as iOS). Other manufacturers are worse at this. Like new Android phones released with older OSes like one plus 5 or not getting updates. S8 still doesn't have oreo 8.0 yet while Pixel is on 8.1
Apple support is still better and you can walk in and they will replace your phone easily and flawlessly for the most part. One time I got a free replacement even though my screen was cracked without apple care.
Note on Software:
Now the only downside for iPhones compared to Android phones right now IMO is software. Some examples includes notifications, bugs (personally I havent encountered major ones like others) or just general outdated things like springboard. However, it remains stable for the most part and does its job. Yes Android does things better. It still has its disadvantages in other things like not one mute button, smooth scrolling in apps and Android JVM is not great and Google still has to fix performance things in 2017 on flagship phones. (It is much better after 6.0 ) General Apps quality as mentioned is still much better on iOS right now.
In the end, you are paying top dollar for your phone and you should expect top class things and for the most part, you get one awesome phone that does its job ...even though there are other android phones that do things better individually but there is no one phone that will be better overall. (IMO Pixel 2 XL comes close if not for its display and its bezels)
Also, you can always update software through OTA but not hardware. I am sure Apple will do its bit to improve its software to match Android.