Apple has complete control over the iOS platform. Apple creates both the hardware in iPhones and iPads, as well as the software in iOS, to give the end user experience. Samsung mainly only develops hardware. Apple can work to ensure that its operating system is fully compatible with its hardware unlike Samsung.
Much of Apple's technology is very innovative. Several Asian companies, such as Samsung, openly copy Apple's technology in the production of their own products. This is not done necessarily as an overt effort to steal ideas, but simply because trade sanctions make many of Apple's products unaffordable in some Asian nations. So Asian companies produce similar, affordable products for consumers. If imitation is truly the sincerest form of flattery, then it is safe to say that Samsung thinks Apple's products are better.
Samsung makes products just as reliable as Apple's, and honestly, easier to use. What Apple does better is innovation and branding. No one can beat Apple in branding. Apple's products are often more innovative than Samsung's initially, but when Samsung catches up, their quality is far just as good if not better
While Apple has continued to be on the cutting edge of technology, it has fallen by the wayside in some of it's innovations. The upgrades to the iPhone have been small, and Samsung has caught up to the brand and even surpassed in many phone models. It's time for something big from Apple in order to not be complacent with its followers.