I'm no expert, but I think you have just asked a MASSIVE question.
In summary though, I suspect it has more to do with skill/ "know how" than expensive equipment.
All that said, my iPhone 5 takes pretty amazing photos that are adequate for 99.9% of my needs.