Some words are derived from old English spellings, especially foods from the old English-speaking world (i.e. potatoes). Some are basically transplanted words from Spanish, especially foods from central and South America (i.e. avocados).
But...tomatoes and potatoes are from Central and South America.