What type of food and how much to carry aboard a boat is mostly dependent on how far it is to the nearest market. For coastal voyagers, a well stocked supermarket can be a month away.
There is no doubt that you should have ample provisions aboard to cover the time away from the next adequate market. But over doing it can mean that a good percentage of food ends up spoiled. The money wasted would have been better kept in cash to buy more fresh stores in the next port.
Small local markets often carry adequate supplies of many types of foods so that those things available locally can be brought from the supermarket in fewer quantities, whereas the types of foods that are only available at large supermarkets will be needed in enough quantity to last until the next stop near a large city.
Another thing to consider is that supermarket prices can vary drastically due to local conditions. For example, the exact same items purchased in St. Thomas in the US Virgin Islands are often double and triple the price they are in supermarkets in Puerto Rico, less than fifty miles away.
* * *