Companion gardening is the practice of planting a diversity of plants together in the same garden space, utilizing it more productively, as well as increasing nutrient efficiency and helping with pest management. There are many plants that are complementary to your vegetables, because they either create a beneficial habitat that attracts desirable insects that prey on the harmful ones, protect vegetables by repelling garden pests or draw pests away from vegetable crops.
Planting deep-rooted vegetable crops with shallow-rooted ones efficiently uses garden space. Tall crops also provide shade for shorter, cool-loving vegetables. Cornstalks provide shade for summer lettuce and support for climbing beans or peas. This is mutually beneficial because legumes fix nitrogen, making it available to the corn, which is a heavy feeding crop. It is claimed that tarragon or basil benefits anything growing nearby.
Attractant plants provide shelter and an alternative food source for beneficial insects. Plants with small flowers that provide nectar and pollen mixed among your vegetables encourages beneficial insects, which eat the garden pests that would feast on your food crops. Nasturtiums and sage are also effective attractants, as are borage, parsley and mint. Bees are attracted by hyssop, peppermint, sweet alyssum and stinging nettle, while predatory ground beetles love clover and amaranth, and beneficial flies and wasps will be drawn by caraway and horehound. Lady bugs and predatory wasps are attracted by yarrow. Other attractant plants include angelica, zinnias, coneflower, dill, anise, fennel, sunflowers and Queen Anne's lace.
Repellent plants disguise the colors and scents of vegetables that pests seek out, or put off odors or chemicals that kill pests or drive them away. Borage repels tomato hornworms and cabbage worms, while flea beetles, aphids and cabbage moths are deterred by mint, peppermint and sage. Oregano and nasturtiums drive away cucumber beetles, spider mites detest dill and coriander, thrips dislike basil and cinch bugs are driven away by soybeans. Geraniums, garlic, tansy, soybeans, white chrysanthemums and rue will send Japanese beetles scurrying and Colorado potato beetles are deterred by horseradish, coriander and flax. Herbs such as thyme, catnip, tansy, marjoram and parsley act as repellants for vegetables that are planted close by, too. In addition, when planted thickly and turned into the soil, scented marigolds repel underground pests.
Trap crop plants are so attractive to garden pests that they are irresistible. Planted near vegetables that are bothered by the specific pests that they attract, trap crops are an effective method of protecting your food crops. Melons are protected by early squash plantings, which attract pickleworms. Earwigs are attracted by chervil, tomato hornworms love dill and lovage, and wireworms are attracted by potatoes. Nasturtiums attract flea beetles and black aphids, beets are protected from leafhoppers by geraniums, and leaf minors love radishes. Four o'clocks, white geraniums and larkspur attract Japanese beetles, which are also toxic to animals and humans. With trap crops, the attractant vegetables are planted specifically as trap crops to distract pests and you should not intend to harvest them.