Beans contain a compound called lectin. Lectins are glycoproteins that are present in a wide variety of commonly-consumed plant foods. Some are not harmful, but the lectins found in undercooked and raw beans are toxic.