I always come back to mushrooms. How many people died trying the different varieties of mushrooms and why would they keep on trying to find the edible ones? I guess it's a bit of "We're going to die anyway, might as well risk it." But still.
And once agriculture is discovered, all the selective breeding over generations to get edible plants. Then in some cases all the processing involved to make the result edible. Like
maize and
nixtamalizaiton. Look at wild corn and compare that to cultivated corn. It's nuts. Then all that goes into making corn digestible.