Usually, it's taste. Secondarily, it's nutrition.
When people were rooted in a particular region -- a river valley, a mountainside, a plain -- they passed down seeds from generation to generation, saving the best from each season. No matter what agricultural challenges prevailed, these seeds could meet them.
Perhaps the soil was rich in minerals from volcanic lava. Or, high in salt from centuries of irrigation. Perhaps the alluvial plain was high in nitrogen. Or, poor from over-cultivation. Perhaps dry winds stripped moisture away. Or heavy fogs rarely cleared.
If the plants were well-suited to the region's woes, then taste could be the deciding factor for selecting next year's stock.
Embedded in this equation is a truism we've only recently begun to understand. Plants that have to fight for survival are frequently more nutritious. Those compounds that aid in the plant's battle against pests and disease play similar roles within our bodies after ingestion.
So, heirloom seeds that are best adapted to particular conditions tend to be fuller in flavor and carry a broader nutrient load.
Today's commercial varieties, selected or bred for ease of mechanical harvest, adaptability toward monoculture or ability to withstand storage and shipment, frequently aren't as flavorful. Nor are they packed with as many trace vitamins and minerals.