Production is cheap because it's massive and economies of scale apply, but distribution is not because it works with every customer inevitably. Every customer in a supermarket needs to interact with a cashier.
Also, transporting, washing, sorting, storing are all scalable but not free, and these are important parts of the easy availability for the end customer. Then, storage is not preserving 100% of produce, some of it inevitably withers or spoils, and handling this is also not free.
Potatoes are only dirt cheap if you buy them in bulk on the farm, then store in your basement, and sort and handle yourself. This is a lot of work and time spent, I've seen such an approach firsthand.
Also, transporting, washing, sorting, storing are all scalable but not free, and these are important parts of the easy availability for the end customer. Then, storage is not preserving 100% of produce, some of it inevitably withers or spoils, and handling this is also not free.
Potatoes are only dirt cheap if you buy them in bulk on the farm, then store in your basement, and sort and handle yourself. This is a lot of work and time spent, I've seen such an approach firsthand.