Why do Android phone's cameras suck?

I don't understand it. This is the sole reason I am still on an iPhone: the camera. Every time I upgrade, no android phone comes close to the iPhone's camera (and now add in the Lumia pureview cams)

Why can't they do it? I was seriously considering upgrading from my iPhone 5 to the Note 3, but looking at sample shots just killed the idea. This is the same for every "good" android camera I've checked out, recently, from the S4, HTC One, Xperia Z1... They are all clearly worse than the iPhone's. The biggest difference in camera quality in my opinion are the macro shots. Now with 5S, Apple continues to blow the competition out of the water.

Why is this? Is it the hardware? The processing software? I don't get it.