They asked for thin and water-resistant. Apple removed the head-phone jack to achieve that. People were initially surprised but Apple was right that really they didn't need it anyway and they're fine about it now. So much so that other manufacturers copied it. People got what they wanted!
This is incorrect; there are several phones that are water resistant and thin, despite having a headphone jack.
The primary motivation was to help sell AirPods (which customers then have to discard and buy new ones every year, because of the battery degradation.)
I don't think you can chalk apple's success up to the hardware, or at least not just the hardware.
Despite my... dislike for the iPhone ecosystem and the way apple runs their app store, it does produce a level of quality and safety that most other systems don't. It works pretty well for people who don't want to have to google things.
I think that for some people that would be worth it even if they don't get the hardware they want (so long as it meets some theoretical "good enough" threshold).
Is it not possible that they give people _almost_ all of what they want, while making one or two changes that are detrimental but not quite dealbreakers?
This is a ridiculous argument against the claims above. If you've invested $100s in iOS apps, you've maybe got homekit, and other apple products, lightning cables, you use iMessage etc, the fact that headphone jacks were removed or batteries are not replaceable and that the products still sold is not proof that's what consumers wanted as there are too many tradeoffs.
The only way to truly tell if that's what consumers wanted would be to go back in time and release 2 nearly identical products. An iPhoneX without headphone jack, non-replaceable battery, water resistant, and an iPhoneX with headphone jack, replaceable battery, same price but not water resistant and see which people choose. I suspect at the time most would have chosen replaceable battery and headphone jack.
Also BTW there are phones that are waterproof that have a headphone jack. Those 2 things are not mutually exclusive.
Apple are giving the best option for their userbase compared to other products on the market. That doesn't mean it's all, or even mostly, what these users want. It only means other products give less.