The core prohibition is biblical: Vayikra 19:19 forbids sowing one's field with mixed species, and the Mishneh Torah (Diverse Species 1:1-10) states that one who sows two species of seeds together, or weeds or covers already-mixed seeds, in Eretz Yisrael is liable for lashes. the Ramban (Vayikra 19:19) explains the reasoning: mixed sowing causes the seeds to change in nature and even form as they draw nourishment from one another, so that each resulting kernel is as though it were a hybrid of two species.
The way to avoid the prohibition is simply distance: Shulchan Arukh (Yoreh De'ah 297:16-17) rules that two different grain species must be separated by a bet rova (roughly ten and a fifth amot square), while two different vegetable species need only six tefachim between the plots, and anything less is forbidden even though not always punishable by lashes; the governing test is whether the two sowings look separated or look mixed together. the Mishneh Torah (Diverse Species 3:11) gives the same bet rova figure for grain next to vegetables or gourds, and the Mishneh Torah (Diverse Species 8:12) adds that all these measures are reckoned with a lenient amah of six tefachim and are never rounded down, since kilayim measures are only ever stringent, not lenient.
Rav Eliezer Melamed (Peninei Halakhah, Kashrut 4:3) frames the same principle in contemporary terms: the basic rule is that if the two species look distinct from one another it is permitted, and if they look intermingled it is forbidden, with the needed gap scaling to the size of the field and the size and spread of the leaves — vegetables biblically requiring one tefach and rabbinically a tefach and a half, grain with tall stalks requiring more. Rav Eliezer Melamed (Peninei Halakhah, Kashrut 4:2) further notes that the biblical prohibition applies only when one plants or knowingly maintains the mixture, so seeds that sprout unintentionally are not biblically forbidden, though the Sages forbade maintaining them even then due to appearances, unless the stray species is too minimal a proportion of the field to create that impression.
Rav Eliezer Melamed (Peninei Halakhah, Kashrut 4:1) adds that the prohibition is limited to annual seed-species fit for human consumption — grains, legumes, and vegetables — so that ornamental or medicinal plants fall outside it entirely, and trees may be planted in any arrangement since their size and height naturally keep them separated; this matches the Mishneh Torah (Diverse Species 1:4), which likewise exempts bitter herbs and roots used only for medicine from kilayim zera'im.
Beyond simple separation, Chazal describe permitted planting patterns that pack multiple species into a small area without any violation: Mishnah Kilayim 2:6 permits laying out a field in parallel strips of different species so long as they are divided by furrows or by the width of a yoke, and Mishnah Kilayim 3:1-2 permits sowing different species of vegetables together in one bed (though not different species of seed-grains), and allows three different vegetables to be sown in a furrow or water channel a tefach deep, one on each side and one in the middle. Shabbat 84b records the classic five-species garden bed of six by six tefachim, with one species on each of the four sides and one in the center, drawn from a drashah on the plural "zeiru'eha" in Yeshayahu 61:11.
The Jerusalem Talmud (Kilayim 2:1-6) discusses how the needed separation can be tapered down the further one divides the bed, narrowing continually with each subdivision, provided the field is laid out as separate garden beds rather than as a single contiguous bed, and cites Rebbi Yannai's practice of sowing fifty species in two rows of twenty-five by this method. Mishnah Kilayim 2:1 separately addresses the case of a measure of grain already contaminated with a different species, ruling that one must reduce the admixture below a quarter-kav, with Rabbi Yose requiring it be picked out entirely.
Vineyard kilayim carries its own, larger spacing rules: Mishnah Kilayim 4:1-2 sets the karahat (bare clearing within a vineyard) and the mechol (gap between vineyard and fence) at sixteen and twelve amot respectively according to Bet Hillel, below which seed may not be introduced at all, and the Jerusalem Talmud (Kilayim 8:1) discusses the alternative six-tefach or four-amah measure depending on whether a fence is built inside or outside the vineyard. Eruvin 92a rules that vines in a large courtyard render it forbidden to sow seeds in an adjoining small courtyard even four amot away, since the smaller courtyard is treated as part of the larger one for this purpose.
Chazon Ish (YD 172) holds that a vineyard requires a four-amah clearance on every side, such that seed sown within that distance becomes consecrated (assur as having grown with the vines) while seed sown beyond it does not, though he raises the possibility that a different spacing might in fact suffice. Chazon Ish (Kilayim 6) adds that where a six-tefach interruption is required, planting one seed above another is nonetheless forbidden unless the upper one is elevated a full ten tefachim, since only that height functions as a genuine partition.
Chazon Ish (Zeraim Likutim 11) surveys the range of topics involved in hilchot kilayim — the species and manner of sowing, the required separations, the corners and locations relevant to vineyard kilayim, the obligation to uproot forbidden mixtures, and the scope of the ban on benefiting from kilayim produce.
Tzitz Eliezer (1:16) rules that grafting within or even beneath a tree's trunk is forbidden, since a seed's growth there could enter the trunk itself, but permits grafting into roots that have already spread out laterally from the tree, since that is not treated as grafting onto the trunk.
Mishpat Kohen (19) challenges the suggestion of permitting a gentile to sow kilayim in a Jew's field as a workaround, arguing that maintaining the resulting mixed planting afterward is itself biblically forbidden, and that one cannot simply assume the mixture will be weeded out or left to wither unwatered.