Not sure what you consider "core hardware" but iPads and iPhones have the best cpus/gpus, among the best (if not the best) displays, and among the best (if not the best) cameras.
I also would not say that "great software" does not cost that much. It costs Apple billions of dollars annually to create that software.