Catherine Delahaye/GettyHave you ever eaten a green potato, or a bunch of rhubarb leaves?Hopefully not, because these two plant parts can be toxic to humans. While they may seem edible, they contain chemicals that can make you seriously ill.Over centuries, humans have learnt which plants are safe to eat and which are not, often by combining ancient knowledge with modern science.The power of plantsWithout plants, we would struggle to get the nutrients we need.Crops such as wheat and rice provide carbohydrates, the body’s main source of energy. Fruits and vegetables contain a wide range of vitamins that help us stay healthy.Plants are also chemical factories. To survive, they produce compounds that deter insects and animals that might eat them. They may also release chemicals that protect them from disease. One example is the tobacco plant which produces nicotine, a natural alkaloid that helps protect the plant from insect attacks.Globally, there are tens of thousands of plants that contain toxic compounds. In Australia, we have more than 1,000 native and introduced plant species that can be toxic to humans and animals, under certain conditions. However, humans only consume a small fraction of the world’s edible plant species.What makes a plant toxic?A key principle of toxicology – the study of what makes something poisonous – is “it’s the dose that makes the poison”. This means certain toxic compounds are safe to consume, as long as you don’t eat too much of them.Table salt is one example. You likely eat it everyday, but this substance can be harmful in excessive amounts. And many plant compounds that sound dangerous are actually safe, when consumed in small amounts. For instance, green potatoes contain glycoalkaloids, a group of chemicals that can cause symptoms such as vomiting, fever and diarrhea when consumed in large amounts. Oxalates are a type of toxin found in rhubarb leaves. They too can make you sick, but only if you eat lots of them.Preparation is keyAt first, humans learnt which plants were nourishing and which were harmful through years of observation and experimentation. For instance, cassava was first domesticated in South America where Indigenous communities developed processing methods to remove cyanide, a poisonous chemical found in the plant’s roots and leaves.Many other First Nations peoples developed sophisticated ways of preparing plants that contained toxins. Some Aboriginal communities in northern Australia would soak, grind or cook cycad seeds to remove naturally occurring toxins before consumption. This knowledge soon became embedded in each community’s culture, as it was passed down through generations. Today, we use various techniques to reduce or remove harmful compounds from plants. For example, raw or undercooked kidney beans contain a natural toxin called phytohaemagglutinin, which can cause illness. But by soaking and thoroughly boiling kidney beans, you can easily get rid of this toxin. Fermentation is another way to remove poisonous chemicals from plants. This is because fermentation changes the plant’s chemistry in ways that can reduce or remove toxic compounds. For example, during soybean fermentation, microbes break down harmful compounds such as phytates and trypsin inhibitors, making the soybeans safer and easier to digest. Read more: Little shop of horrors: the Australian plants that can kill you The role of modern scienceIn some cases, scientists have modified toxic plants to make them safe to eat. Faba beans, also known as broad beans, are one example. Faba beans are an increasingly important crop for Australian farmers, as they can attract high prices and help manage weeds. Like many plants, faba beans naturally contain vicine and convicine, two compounds that generally don’t affect humans. But in people with a genetic condition called G6PD deficiency, they can trigger a serious reaction called favism. This condition can be life-threatening as it causes your red blood cells to rapidly break down.Rather than abandoning this crop, scientists have used modern chemistry and plant breeding to develop new faba bean varieties with lower concentrations of these compounds. And farmers are already planting low-vicine varieties as part of their crop rotations.Over millenia, humans have unpacked the complex chemistry of plants to learn what is safe to eat. But how we consume these plants, and how much of them we eat, also affects how toxic they may be.Joel Johnson receives scholarship funding from the Australian government for his PhD program. Mani Naiker does not work for, consult, own shares in or receive funding from any company or organisation that would benefit from this article, and has disclosed no relevant affiliations beyond their academic appointment.