Apple came out with a superior product, but has been losing ground not because other products are better, but because people don't want the iPhone with Apple attached to it.
Most of the people that I know, including die hard Macheads have their iPhones jailbroken. Apple could have maintained a much larger lead on Android had they adopted some of its openness. Instead they became very controlling, doing a 180 on the previous two decades of corporate philosophy.
Apple created its own competition when they came up with a superior product that was hard to beat, but they really gave that competition a leg up through its business practices, and its increasingly hard line attitude towards everything.
@panda218 yes I believe is misleading because iPhone sales are only going up and it's market share is very steady. Apple is the only manufacturer for iPhones and they only have 1 model for sale, if you compare Apple's market share against individual smartphone manufacturers you'll find them very near the top.
But lots of Android products are better. Look at the samsung i9000 and i9100. Or the HTC sensation.