I consider that both companies are creating high quality smartphones but I am inclined more towards Samsung and I will state my case why. First thing that comes to my mind is price. Samsung has made cheaper smartphones that Apple for years and while some years ago the quality was lower than the one Apple offered now I can say that it is pretty much the same. However Samsung seems to ask a bit less on their equivalent flagships with Apple than Apple does.
Then there is the operating system which is a very subjective area. There are users who would absolutely not ditch their IOS for android while others would never even touch IOS. I am somehow in the second category and also a Samsung user for more than three years. I like android better because it is much more customization to play with than IOS has and you have much more control on your device using android than you have on an iPhone.
Battery life is also an important aspect when choosing a smartphone for me and Samsung has proven with every generation that it has a better battery than iPhone does. No matter what generation we would compare the equivalent Samsung has outperformed iPhone in terms of battery life. Plus a few years ago it still had replaceable batteries which iPhone never had. The differences are not huge but it's still worth choosing Samsung.
The displays build by Samsung are the best smartphone panels. Period. No matter what iPhone might say about their retina displays, Samsung has proved to be able to manufacture the best AMOLED displays for years. It is even providing iPhone with displays. There were years in which Samsung was offering quad HD displays while iPhone was still on 750p or something like that. In terms of a display I would choose a Samsung at any hour over an iPhone.
Last but not least I will mention that using your smartphone with a google account seems easier and has more benefits, even of storage, than iCloud and you have much more freedom with a Samsung. The freedom to copy paste any type of music or photos you like on your smartphone direct from a PC while on iPhone you have to use iTunes and all sort of other programs and it's also easier to connect other accessories also to a Samsung than it is with a iPhone.
As a conclusion I would definitely choose a Samsung over an iPhone at any time and by now Apple still hasn't convinced me to pay what they asking for their smartphones. There are simply better options from Samsung that are also slightly cheaper. That's how I see it. Hope you will find my comparison interesting and wish you a great day!
I prefer my samsung. My wife however swears by her apple products. My phone is very robust and problem free. Her I phones (all of them) seem to be in the shop because of a broken screen or a microphone being out or any other various number of reasons. My samsung is almost 5 years old and my only complaint is that the battery does not hold a charge well anymore. Never had a broken screen or had to have it repaired in any way.
Each product has its own advantages and disadvantages. Then it is impossible to judge which is better between the two. Just use it according to your needs and interests.