Apple does a much better job at keeping iPhones up to date for several years. For example, the Galaxy S7, which is barely a year old, isn't running the latest version of Android on some carriers, and it has been about six months since Google released that version. On top of that, Samsung made loads of unnecessary modifications to Android. Here's more details on why the iPhone is better than Samsung.
Do people prefer Apple or Samsung? The majority chose Apple. Actually everyone except one person chose Apple. Some reasons they gave for choosing Apple is that apps usually come out on iOS first, it's easier to use, it's easy to put in your pocket, etc.