There is no single explanation of how fruits and vegetables got their names. Some were named after their appearance, some after their place of origin, some because they resembled something else, and so on.
Here are some examples of how this happened.
Strawberry was originally called "strayberry," because its runners stray from the parent plant in all directions. The blackberry owed its name to its color. The cranberry was originally called "craneberry" because its slender stalk resembles the long legs and neck of the crane.
Currants were named after Corinth, from which they first came. Cherries got their name from a city called Cerasus. Grape is the English equivalent of the Italian grappo, which means a bunch. Raisin is'a French word which comes from the Latin racenus, meaning a dried grape.
Orange goes back to the Arabic word narandj, and lemon to the Arabic word lamium. Melon is the Greek word for apple. Tomato is the West Indian name for "love apple." The pineapple owes its name to its conical shape, which resembles the pine tree.
Cabbage was originally written "cabbish." It comes from the Latin capitas, having a head. Lettuce comes from the Latin lactuca, because of it conĀtains "lac," or milky juice. Rhubarb comes from the Latin rhabarbarum. This meant the "root of the barbarians," because the Romans considered the people who ate it barbarians!
Radish is from the Latin radix, a root. Bean is Anglo-Saxon from the Greek and Latin puanos. And potato is our way of spelling the Spanish word patata.