even with the best software in the world, a decent midrange camera will still take better photos than any phone you can fit in your pocket.
sensor size, lens size, optics, light gathering ability, all of that matters. software can compensate for a lot, but it cannot repeal physics.
the same thing applies to foldable phones. if a display is being bent over and over again, there is no realistic way for that section to remain completely unaffected forever.
folding the same screen hundreds of thousands of times in a controlled lab and saying, "see, no crease, problem solved," does not mean much in real life. people drop phones, sit on them, expose them to heat, cold, dust, pressure, uneven folds, …