Land Insects [שרץ הארץ]
Became Infested While Attached or Detached
21. Attached. The Torah only forbids insects that arise on the ground. Thus, if a fruit becomes infested while connected to the ground or tree, the bugs are called “land insects” and may not be eaten even if they did not come out of the fruit. They are assur even after the fruit is detached from the ground (שו''ע יו''ד סי' פ''ד ס''ו ).
22. Detached. However, if a fruit became infested once it was no longer connected to the ground, the insects may be eaten as long as they do not come off the fruit. Once they come off the fruit, they are assur (שו''ע שם ס''ד ).
23. Uncertain. If one is unsure whether it became infested while still connected to the tree [in which case it is assur] or only after it was detached and the bugs have not come off the fruit [in which case it is mutar] the bugs are assur (שו''ע שם ס''ז ). If a certain fruit is commonly infested, one must check the fruit before eating it, as will be explained below.
24. This is the case with most commonly infested produce available in stores today. We are unsure whether it became infested while connected or after becoming detached. Thus, we must be machmir and treat the bugs as assur, and there is a chiyuv to check the produce if a significant minority of it is infested (כף החיים סי' פ''ד אות ס''ג ).