|oleander: very beautiful, very poisonous|
The answers to that will depend on the plant, of course, but one explanation is that not all the animals that would eat a plant are put off by spines. Spines or thorns long enough to hurt a deer may be totally ignored by a small moth that lands between them and lays eggs that develop into voracious plant-eating caterpillars.
The Society for Economic Botany, focused on the study of useful plants, recently estimated that half of the world's 400,000 plants could be eaten (link). Which lets me suggest that the other half are not edible, many of them protected by toxins that make nibbling them a really bad idea. The link I just cited above goes on to say many of the plants we eat are actually toxic as well. Cassava, for example, requires treatment to be safe to eat, and potatoes and rhubarb have toxic leaves, so we don't eat their leaves.
The world is full of dangerous plants. Mothers teach us not to put all the leaves in the back yard in our mouths. And, in fact, if you don't taste the plants around you, you can navigate safely between some very toxic species.
We all do, daily.
Which ones? As mentioned, potatoes and rhubarb. In potatoes (Solanum tuberosum, nightshade family, Solanaceae) leaves and stems contain the toxin solanine (link) which in sufficient dosage causes serious poisoning. Generally the potato tubers we eat do not contain much solanine, but if the potato skin is green not brown, it likely has enough solanine to upset your stomach. Peel it!
|Brown-skinned potatoes: safe to eat|
|Rhubarb leaves: do not eat!|
|Isn't the plant foxglove (Digitalis) beautiful?|
Just don't ingest it.
|Swamp milkweed: do not eat.|
|lily-of-the-valley, Convallaria majallis|
|Dandelions are beautiful but shouldn't be eaten.|
|Dumb cane, Dieffenbachia|
This post has focused on dangerous leaves. Mild toxins in a leaf give a grazing animal a bad experience--nausea for example. After that, the animal isn't likely to eat a second leaf. Many, many plants are therefore mildly toxic, if all you eat is one bite. Slight toxicity is the chemical equivalent of the spine: BACK OFF!!! After a nasty experience, not only will you leave that plant alone but you are likely to teach others to avoid it. Most mammals and many birds teach their young what to eat, so learned avoidance is very helpful to plants.
The plants in this post show you that many common plants protect their leaves with toxins. We live next to them safely because we don't eat them.
If you put a plant into your mouth, be very sure you know that it is safe!
Comments and corrections welcome.
See for example:
Common Poisonous Plants and Plant Parts http://aggie-horticulture.tamu.edu/earthkind/landscape/poisonous-plants-resources/common-poisonous-plants-and-plant-parts/ Accessed 3/10/16
The Poison Garden http://www.thepoisongarden.co.uk/default.htm Accessed 3/12/16
More at awanderingbotanist.com