The foundation is the Torah's own distinction between permitted and forbidden creatures, which Vayikra 11:43-47 frames as a matter of sanctification and not merely dietary preference, and which Devarim 14:4 and Sefer HaChinukh 154:1-2 spell out through the signs of permitted animals, while Sefer HaChinukh 73:4-5 catalogs the categories of terefah and notes that any doubt regarding the most severe category, derasah, is treated stringently.
Because one cannot always see with one's own eyes whether food was prepared properly, Chazal built a body of law around relying on others: Mishneh Torah, Forbidden Foods 11:25 and Mishneh Torah, Forbidden Foods 8:7 permit buying meat, wine, and cheese only from a seller established in reliability, and Arukh HaShulchan, Yoreh De'ah 119:5-6 elaborates that one may not rely on a seller suspected of eating forbidden items, though an unsuspected person retains a presumption of reliability. This extends to direct observation of slaughter in Chullin 12a:2-4, to the general principle of relying on presumptive status in Chullin 10b:7-8, and to the Mishnah's treatment of one suspected regarding firstborn animals or tithes in Bekhorot 29b:4-5, Bekhorot 30a:1-2, and Bekhorot 30b:1-2, while Chullin 5b:8-10 and Chullin 6a:2-3 and Chullin 5a:6-8 discuss the reliability of a Samaritan's or transgressor's slaughter specifically.
When a forbidden substance becomes physically mixed into permitted food, the halacha turns on whether its taste can be detected and on proportion: Mishneh Torah, Forbidden Foods 15:1-2 and Shulchan Arukh, Yoreh De'ah 98:1 hold that a different-type mixture is forbidden only if its flavor is detectable, while a same-type mixture is nullified in a majority, and Mishneh Torah, Forbidden Foods 16:5 adds that a recognizable, intact piece of forbidden food must be removed before the remainder can be measured for nullification. Pesachim 30a:1-3 and Pesachim 76b:1-2 apply related mixture principles to chametz and to meat roasted together, respectively.
Concern about contamination or substitution by a non-Jew generates its own set of safeguards: Shulchan Arukh, Yoreh De'ah 118:1 and Kitzur Shulchan Arukh 46:16 require items such as wine, meat, or unidentifiable fish sent via a non-Jew to bear two seals, while rabbinically prohibited items need only one. Shulchan Arukh, Yoreh De'ah 115:1-3 addresses milk milked by a non-Jew unseen by a Jew, forbidding it out of concern for admixture of non-kosher milk, a concern also reflected in the mishnayot of Avodah Zarah 35b-36a and Avodah Zarah 39b-40a and in the discussion of fish preparation in Avodah Zarah 39a:2-3.
A separate strand concerns not eating forbidden food oneself but facilitating or appearing to facilitate its consumption by others: Shulchan Arukh, Yoreh De'ah 117 forbids trading in food that is itself forbidden to eat, and Rav Gavriel Zinner (Nitei Gavriel, Bein HaMetzarim vol 1, perek 38) distinguishes a case where purchasing food may lead others to transgress, which is forbidden, from a case lacking that concern, which is permitted. Avnei Yashfeh 6:143 considers whether eating uncertified but inherently kosher food in an uncertified restaurant creates a problem of marit ayin, noting that such concern can apply even where observers would only suspect wrongdoing, and Levush, Yoreh De'ah 152:2 distinguishes attending a non-Jew's feast from receiving food sent to one's own home.
Several sources address the consequences of having eaten forbidden food rather than the permissibility question itself: Kitzur Shulchan Arukh Yalkut Yosef, Orach Chaim 196:1 rules that no blessing or zimun is recited over forbidden food even if only rabbinically prohibited, Kitzur Shulchan Arukh Yalkut Yosef, Orach Chaim 308:152 treats uncertified products as possibly muktzeh due to the concern of forbidden admixtures, and Tanya, Part I; Likkutei Amarim 8:1-3 together with Tanya, Part I; Likkutei Amarim 7:9 describe the spiritual effect of eating forbidden food even unintentionally, holding that its vitality remains bound to impure forces unlike permitted food.
Shevet HaLevi (Shevet HaLevi 2:26) takes up the concrete case of a seriously ill hospital patient whom doctors have forbidden from eating salted or roasted meat for medical reasons, where the patient refuses any alternative food.
Az Nidberu (Az Nidberu 9:13) holds that food is subject to a genuine prohibition even when it was opened by someone else, but permits leniency in cases of need by treating the situation as comparable to an inadvertent act, and states that the bones themselves are permitted.
Modern treatments extend these principles to contemporary situations: Gray Matter IV, Israel, Kashrut in Combat Conditions reads the Torah and the Gemara in Chullin 17a as permitting consumption of non-kosher food found in conquered Canaanite homes, Contemporary Halakhic Problems, Vol VI, Chapter 8 Piscatorial Parasites applies the Gemara in Chullin 67b and Shulchan Arukh Yoreh De'ah 84:16 to determine which parasites found in fish are forbidden versus permitted, and Rav Eliezer Melamed (Peninei Halakhah, Kashrut 28:6) defines the scope of the prohibition on food cooked by a non-Jew as limited to foods not normally eaten raw.
Additional sources round out the picture of doubtful status in slaughter and ingredients: Mishneh Torah, Ritual Slaughter 3:18 rules that any doubt in slaughter is treated as a doubt of nevelah, Mishneh Torah, Ritual Slaughter 3:14 works through a specific case of uncertain timing of a dislodged simman, Haamek Davar on Devarim 14:21 explains that the term nevelah includes any improperly slaughtered animal because of the Torah's emphasis on Israel's holiness, and Kuzari 3:49 reflects on the relative severity people mistakenly assign to different forbidden foods and drinks. Shulchan Arukh, Yoreh De'ah 81:1 and Bach, Yoreh De'ah 81:3-4 discuss derivatives of forbidden animals such as milk and cheese and the handling of uncertain treifah status, and Mishneh Torah, Defilement of Foods 1:1 and Chullin 6b:1-3 touch on separate concerns of ritual impurity and reliability of food handlers.