A big reason Apple does so well is that their phones are well designed and well manufactured. By contrast, there always seem to be concerns about Samsung's build quality (cheap plastic parts that don't feel well put together) and Samsung's cell radios are typically mediocre. Additionally, even top end Samsung phones occasionally lag because of all the bloatware that Samsung puts on their phones, which you can't easily remove.
Personally, I am avoiding Samsung phones because of these issues. There are some other great phones, often at far cheaper prices. The Nexus series, the Motorola Moto series, and (as BYUMizzou mentions) the newer Chinese phones like the OnePlus One.