Most plants evolved mechanisms to stop their seeds and sprouts being eaten and digested. Legumes can be toxic to eat raw, contain aflatoxins and cause digestive issues - but they don't contribute much to your diet besides a bit of protein.
And most humans developed a method to make inedible foods edible: cooking.