Compared to most new mirrorless or DSLR cameras, an iPhone is cheaper. A mirrorless or DSLR camera may have better sensor and optics (if you buy the right glass) BUT the computational capabilities of the phone far outstrip the computational capabilities of the camera.
I find that modern phones are better than traditional cameras a) by nailing exposure more consistently in tricky lighting conditions, b) having a far better display for proofing your shots, and c) can use computational photography tricks to create great HDR photos.