Most of these smartphone makers have slight advantages over the other and that is why they are still in the business. But Samsung has been making waves and has one important characteristic against many and this might also be the reason why it is on the brink of unseating the most profitable smartphone vendor, which is Apple.
Samsung's cost of production for the S 4, and other Samsung devices for that matter, can be comparable to Apple's but half of the components for these devices are sourced out from their own plants, which means that half of the cost goes back to their bank account and that they already earn money even before they sell S 4 units. Whereas Apple sources out most of its components from others, which means that they only become profitable once they have sold the iPhone units.
Furthermore, Samsung has control over the component and the production of their units and that they are not at the mercy of third party providers who can easily leave them hanging, like in bottle neck productions. The report came from Wayne Lam who analyzed that these leaves Samsung with a bigger advantage over all other smartphone manufacturers.