The Mishnah in Pesachim (.דף ל"ה) lists five types of grain with which one can manufacture the product needed to fulfill one's obligation on Pesach, meaning, as Rashi (שם בד"ה אלו) explains, the obligation to eat Matzoh on the first night, when it is mandatory, as stipulated in the Torah שמות י"ב:י"ח(). The five grains are wheat, barley, spelt, rye, and oats; the Gemara (שם) notes that spelt is actually a type of wheat, while oats and rye are types of barley. The Gemara then states (שם) that other species, such as rice and millet, cannot be used to produce Matzoh, and this is based on a Posuk later in the Torah (דברים ט"ז:ג') which establishes a connection between the prohibition to eat Chometz on Pesach and the obligation to eat Matzoh, indicating that one can use for the Mitzvah of Matzoh only the types of grain which could possibly become Chometz, which are the five types mentioned above, and no others. The Mishnah in Challah (פרק א' משנה ב') states clearly that one who eats a Kezayis of Matzoh made from any of these five types of grain fulfills his obligation on Pesach night, while one who eats a Kezayis of Chometz made from one of these items is punished with Kareis, premature death, as the Torah states is the punishment for eating Chometz (שמות שם פסוק ט"ו).
Although one authority in the Gemara in Pesachim (שם) holds that rice is a type of grain as well, so that one who eats Chometz made of rice is punished with Kareis, and one who eats Matzoh made of rice fulfills his obligation, the Rambam (פרק ו' מהל' חמץ ומצה הלכה ד') rules that one does not fulfill the obligation to eat Matzoh unless it is made of one of the aforementioned five types of grain, because Matzoh must be made of something that can in fact become Chometz, while rice, millet, and "Kitniyos," meaning legumes, can not become Chometz and thus can not be an ingredient in the Matzoh used for the Mitzvah on Pesach night. The Rambam earlier (שם פרק ה' הלכה א') states similarly that the prohibition against eating Chometz on Pesach applies only to something made of the above five types of grain, but Kitniyos, such as rice, millet, beans, lentils and the like, are not Chometz, and, consequently, even if one kneads flour made of rice, for example, with hot water, and bakes it and processes it so that it rises and looks very much like regular dough, one may still eat this product because it is nevertheless not called Chometz. The Rosh in Pesachim (פרק ב' סימן י"ב) also writes that rice and millet and any other product which is not made from any one of the five aforementioned grains can not become Chometz, and it is thus permissible to cook such products for Pesach. The Korban Nesanel (שם אות ע') notes that there is no need to outlaw these cooked products just because they may appear similar to other cooked products which are actually Chometz; he proves this point by referring to a comment of the Rosh later in Pesachim (שם סימן כ"ח), where he explains the implication of a Gemara there (שם דף מ: ועיין שם בתוד"ה רבא) that one may use a certain type of flour, made from lentils, because it can not become Chometz, and states that there is no need to worry that people will confuse it with other flour which is really Chometz. The Korban Nesanel )שם( concludes, however, that Ashkenazic Jews have accepted a great stringency regarding these products; he is clearly referring to the practice of Ashkenazim to avoid eating any such Kitniyos products on Pesach, despite the fact that they are not Chometz, and despite the permissibility of these items documented by the above sources.
The earliest authority who records the practice not to eat Kitniyos on Pesach seems to be the Semak (ספר עמודי גולה, סימן רכ"ב, הערה באות י"ב), who states, writing in the 1200's, that people have refrained from eating such food on Pesach since the days of the early Chachomim and Rabbonim. He then adds that the prohibition is not based on the fact that these products can become Chometz, because it is known that they can not, as explained above, since only something made of the five species of grain can become Chometz; rather, the reason for the prohibition is based on a Gezeirah, a preventative decree from the Rabbanan, instituted because people can too easily confuse a product cooked with Kitniyos, such as cereal, with a similar product cooked with one of the five grains, and if the Kitniyos product is allowed, one may come to allow a grain product, which is really Chometz, as well. Moreover, he adds, Kitniyos are similar to the five grains in other ways too, including the fact that some people make bread out of Kitniyos as they do from the five grains, and people who are not knowledgeable may end up making a mistake and eat real Chometz; he points out that Kitniyos are thus not like other vegetables which are allowed on Pesach because they will never get confused with the forbidden grains. He thus concludes that it is a proper custom to avoid eating Kitniyos, including, as he adds, mustard, and he notes that although the Gemara cited above (שם דף ל"ה.) clearly allows eating rice on Pesach, that was only in those days when people knew all the Halachos properly, but today, one must not eat Kitniyos on Pesach. This position is cited in the Mordechai in Pesachim (סימן תקפ"ח, דף ל"א:-ל"ב. בדפי הרי"ף) as well. Rabbeinu Manoach, in his commentary on the aforementioned Rambam (פרק ה' שם, מובא במהדורת המשנה תורה שנדפס ע"י ר' שבתי פרנקל), quotes that some say that the custom is not to eat certain products with seeds on Pesach because they can become Chometz, but he rejects this because Kitniyos simply can not become Chometz; he suggests instead that the Torah's requirement to rejoice on Yom Tov (עיין דברים שם פסוק י"ד) precludes eating food cooked out of Kitniyos (apparently because such food is of inferior quality) and it is from this idea that the custom developed. He then adds that there really can be no true prohibition at all on Pesach for one to eat Kitniyos if one wants to, but he concludes that he found an authority who explains that there are certain wheat crops which, when they don't grow properly due to certain agricultural factors, come out looking like Kitniyos crops, even though they are indeed from the wheat species, and the Rabbanan thus prohibited all Kitniyos crops in order to avoid confusion, and he believes that this is a solid basis for the custom to avoid eating Kitniyos on Pesach.
The Tur (אורח חיים סימן תנ"ג) writes that rice and all types of Kitniyos can be cooked on Pesach because they can not become Chometz, but he adds that some forbid these products because sometimes certain types of wheat get mixed in with these items and it is presumably difficult to differentiate between the wheat and the Kitniyos; he concludes, though, that this is an excessive stringency and it is not customarily followed. The Beis Yosef (שם בד"ה ויש) quotes others who question this custom as well, but then cites some of the above sources that prohibit eating Kitniyos on Pesach, presenting the aforementioned reasons for the prohibition; he concludes that only the Ashkenazim are concerned with this prohibition, and the Ramo, in his Darkei Moshe (שם אות ב'), asserts that the Ashkenazim are indeed stringent about this. The Bach (שם בד"ה ומ"ש) suggests that the true reason for this custom is that since it is possible to make dough out of Kitniyos products, there is concern that confusion will arise among uneducated people concerning dough made of grain which is truly Chometz. The Shulchan Aruch (שם סעיף א') rules that rice and other types of Kitniyos can not become Chometz, and one may thus cook these items on Pesach, but the Ramo (שם) states that some forbid these items, and the Ashkenazic custom is to be stringent and should not be changed. The Mishnah Berurah (שם ס"ק ו'), basing himself on the above cited sources, explains that this stringency is designed to prevent confusion between flour and bread made from Kitniyos products and flour and bread made from the five grains which are real Chometz; he also writes that the Chometz grains are sometimes mixed together with different types of Kitniyos, and if such a mixture is baked or cooked, it can indeed become real Chometz. He concludes שם(), citing the Chayei Adam (כלל קכ"ז סעיף א'), that to cook even whole pieces of rice or Kitniyos (as opposed to pieces that have been made into flour or dough) is also prohibited in order to maintain consistency within this custom; in the Biur Halacha (שם בד"ה ויש), he quotes and explains the above cited opinion of Rabbeinu Manoach (שם) to further justify this custom. The Aruch HaShulchan (שם סעיף ה') also presents a source which he believes is a basis for this custom.
Rav Yaakov Emden, an Ashkenazic authority, objects strongly to this custom, though (ספר מור וקציעה על שו"ע או"ח שם), complaining that because people don't eat Kitniyos, they have to bake that much more Matzoh, and people simply are not sufficiently careful when baking so much Matzoh; he notes that the Tur cited above (שם) does not accept this practice although he is an Ashkenazic authority. He then adds that his own father, the Chacham Tzvi, also objected strongly to this custom, saying that he would abolish it if he would be able to, because it is a bad custom and a stringency which leads to unacceptable leniencies with real prohibitions involving Chometz; he thus expresses the desire to join someone who would be able to do away with this custom to refrain from eating Kitniyos on Pesach. The Kaf HaChaim (שם אות י') quotes others who agree that this is an improper custom, but he notes that even among Sephardim, who generally do not observe this custom, there are those in Yerushalayim who do not eat rice because it once happened that some wheat was found in a cooked rice product. This story is also found in the Pri Chodosh (שם ס"ק א'), who finds a hint to the general custom of avoiding Kitniyos on Pesach in the aforementioned Gemara in Pesachim (דף מ:) which records that one of the Amoraim was concerned about using flour made from lentils, which are Kitniyos, in a place where the people are not careful or knowledgeable about Mitzvos, because of the possible confusion with flour made from real Chometz. He concludes that since people today are indeed less diligent about these matters, it is proper to avoid any products that are similar to grain, although he notes that the Sephardim generally do not follow this custom. The Kaf HaChaim (שם) does quote some Sephardic Poskim who forbid Kitniyos as well, but he concludes that many Sephardim do not observe this practice at all.
The Maharatz Chayes, however, in an essay entitled "Minchas Kenaos" (נדפס בספר כל ספרי מהר"ץ חיות חלק ב', בהערה בעמודים תתרכ"ז-תתר"ל), quotes verbatim the words of Rav Yaakov Emden referred to above (שם) in opposition to this custom, but he then defends the custom strongly against Rav Yaakov Emden's objections, stating that it is wide-spread in Ashkenazic communities, and that it can not and should not be undone, because a custom that has become accepted becomes like a law from the Torah. He thus concludes that there is no possibility of changing the practice and allowing Kitniyos to be eaten on Pesach. The Shaarei Teshuvah (שם ס"ק א') reports that there were those who attempted to do away with this practice, but were unsuccessful because the Gedolim among the Ashkenazic leaders maintained it strongly; he states that there is no room for leniency, and that anyone who is lenient is "breaking down the fence," meaning that he is violating the accepted norm. The Shaarei Teshuvah (שם) also quotes from the Maharil (ספר מהרי"ל, הל' מאכלות אסורות בפסח, דף י"ח:) that one who eats Kitniyos on Pesach is violating the prohibition of לא תסור (עיין דברים ט"ז:י"א), which forbids one from disobeying the decisions of the Chachomim, as implied by the Gemara in Berachos (דף י"ט:), and he adds that anyone who goes against the rulings of the Rabbanan is deserving of death. The Chasam Sofer (שו"ת חתם סופר חאו"ח סימן קכ"ב), among others, also discusses this entire issue at some length, and decides that one can not change the practice of the greater community; he also suggests another source for this practice.
There is, however, some question as to exactly which products fit into the broad category called "Kitniyos;" Rav Dovid Tzvi Hoffmann (שו"ת מלמד להועיל חאו"ח סימן פ"ז) states that the term "Kitniyos" is not really precisely defined by the Poskim. The Rambam cited above (שם) mentions rice, millet, beans, and lentils as examples of Kitniyos, but there are other products which fall into this category as well, and the Rambam himself elsewhere (פרק א' מהל' כלאים הלכה ח') adds another type of bean, along with sesame seeds and other types of seeds and beans to the list of products which are in the general category of Kitniyos, saying that any seed which people eat is in the category of Kitniyos. The Shulchan Aruch (יורה דעה סימן רצ"ז סעיף ג') gives the same examples to define the term Kitniyos. It appears from the aforementioned Semak (שם) that produce which grows in a manner similar to the way the five types of grain grow is also included in the prohibition against eating Kitniyos; the Taz (או"ח שם ס"ק א') seems to agree, explaining that this is why mustard is considered Kitniyos, while the Shulchan Aruch HaRav (שם סעיף ד'), who agrees regarding mustard, adds that certain caraway seeds are also considered Kitniyos for the same reason. The Pri Megadim (במשבצות זהב שם ס"ק א') discusses the status of coffee, as does the aforementioned Shaarei Teshuvah (שם), and both conclude that it is permissible and is not in the category of Kitniyos; in general, the Chok Yaakov (שם ס"ק ט') implies that one should not add to the list of Kitniyos products prohibited by the Chachomim and by the force of custom, because the whole prohibition against eating Kitniyos is a stringency to begin with. Nevertheless, there are other products which are indeed considered Kitniyos as well; the Mishnah Berurah (שם ס"ק ג') mentions buckwheat and corn, for example, prohibiting their consumption on Pesach, Rav Moshe Feinstein (שו"ת אגרות משה או"ח חלק ג' סימן ס"ג) discusses the status of peanuts, which some people avoid on Pesach, and the Sefer She'arim HaMetzuyanim BeHalacha, commenting on the Kitzur Shulchan Aruch (סימן קי"ז ס"ק ז' בד"ה ופולין), mentions that green beans and, apparently, peas, may be considered Kitniyos as well. It is clear that the precise definition of Kitniyos relating to Pesach depends on customs which may vary from place to place.
The Sefer She'arim HaMetzuyanim BeHalacha (שם בד"ה והתוצרת) also discusses the major question of whether liquid derivatives of Kitniyos products (מי קטניות), such as oils or syrups, are included in the prohibition against consuming Kitniyos; the Chayei Adam, in his Nishmas Adam on Hilchos Pesach (שאלה ל"ג), seems to forbid these items as well, citing, among others, the Terumas HaDeshen (שו"ת תרומת הדשן סימן קי"ג) who writes that one may use oil from Kitniyos for lighting candles, implying that one may not, however, consume it. The Avnei Neizer (שו"ת אבני נזר חאו"ח סימן שע"ג), among others, also assumes that the liquid products of Kitniyos are included in the prohibition. The Chok Yaakov (שם ס"ק ו'), however, appears to take the lenient view about this, as do Rav Dovid Tzvi Hoffmann (שו"ת מלמד להועיל שם סימן פ"ח), who quotes Rav Shimshon Raphael Hirsch, and the Seridei Eish (שו"ת שרידי אש חלק ב' סימן ל"ז), and others; Rav Tzvi Pesach Frank, in his Sefer Mikraei Kodesh on Pesach (חלק ב' סימן ס' אות ב', ועיין שם בהררי קודש הערות 7-5) discusses this question and notes that Rav Chaim Soloveitchik allowed the oil from a certain product to be eaten, but he implies that it may depend upon how similar the original Kitniyos product is to the five species of grain that can become Chometz. Rav Moshe Feinstein, in his aforementioned Teshuvah (שם), writes, though, that in a place where there is no custom prohibiting a particular product, one should not be stringent and avoid it.
It must be pointed out that the entire restriction on Kitniyos on Pesach pertains to consuming such products, but one may have them in one's possession and even use them in other ways on Pesach, as the Ramo (שם) states clearly, and one may also derive benefit from them, as the Magen Avraham (שם ס"ק ג') writes. It should also be noted that although the Sdei Chemed (אסיפת דינים, מערכת חמץ ומצה סימן ו' אות א') quotes some authorities who prohibit eating Kitniyos under all conditions, he also quotes some who are lenient in pressing situations; the Chayei Adam, in his Nishmas Adam (שם שאלה כ') leaves the question of such leniency in doubt, but in the Chayei Adam itself (שם סעיף ו'), he states clearly that in a case of even a mild illness, or for the sake of a baby, where there is a significant need, Kitniyos may be consumed. The Mishnah Berurah (שם ס"ק ז') also rules that in a case of great need, one may consume Kitniyos products, although he notes that even in such a situation, there are some types of Kitniyos which should be preferred over others; it would appear to be advisable, moreover, to use separate utensils for these products.