In addition to flavoring your recipes and making a soothing tea, thyme can improve the health of other garden plants. It’s particularly good at attracting beneficial insects, and warding off pests.
How to Repel Bad Bugs and Attract Good Bugs with Thyme
Thyme attracts two different categories of good bugs to your garden – pollinators and beneficial insects.
Pollinators like bees and butterflies are drawn to thyme’s abundant blossoms.
Our thyme is always full of bees. (Since we let our thyme take over parts of our lawn, this means I have to be somewhat careful when going barefoot.) The Herb Society of America also describes thyme as a nectar source for butterflies.

Thyme blooms earlier than many other plants, so it can attract and support pollinators early in the season and get them used to coming to your garden.
Thyme is also a host plant for syrphid flies and ground beetles. Syrphid flies are very good at destroying aphids, while ground beetles go after aphids and also after mites, which may attack your plants.
Thyme also acts directly to repel certain pest bugs. Toronto master gardener members have noted that its aromatic oils are generally bug-repelling and have been known to repel both ants and cabbage moths in their gardens. Though thankfully, they don’t repel pollinators.
Thyme’s Friends in the Vegetable Garden
The Payne County Extension says that thyme is a particularly good companion for brassicas (broccoli, Brussels sprouts, cabbage, kale, etc.). This may be because it repels cabbage moths, which eat plants in that family. Thyme is also a good neighbor to eggplant, potatoes, strawberries, and tomatoes.

When, Where, and How to Plant Thyme with Other Crops
Thyme is a fairly aggressive spreader, though not as aggressive as mint. Keep this in mind when you’re planning companion plantings, and don’t set it right next to more delicate plants, which it can overwhelm.
Placement
Thyme is a low-growing plant. Most varieties don’t grow more than 12 inches high, and some compact varieties stay below 6 inches. So thyme could be grown underneath taller plants, if the taller plants are already established when the thyme is put in place.
Since thyme is perennial and most garden vegetables are annual, working thyme into a vegetable garden rotation could be complicated. It might be easier to plant thyme around the border of your garden, or in a dedicated bed around which other crops rotate. If you garden with raised beds, you might be able to use thyme as a ground cover in the walkways between beds.
Another idea is to dig out circles in an established bed of thyme and set vegetable seedlings into these circles. I have planted brassica seedlings into clover in this way with fairly good results. When the vegetables are young, you’ll need to keep tearing the thyme back so it doesn’t crush them. They grow fairly quickly and may soon be able to fend for themselves.
I would be more hesitant to grow thyme under tomatoes and potatoes. These plants are prone to fungal diseases, which thrive on wet leaves. I try to space them widely and keep the soil bare (or mulched with something flat) under them to improve air circulation. You could still grow thyme in paths, borders, or nearby containers.
The Flexibility of Growing Thyme in Containers
Thyme also grows well in containers. You might set up some containers permanently in your garden, or move small containers to keep thyme close to good companion plants. Remember to trim off stems that creep down over the sides of the container if you don’t want your thyme escaping into the rest of the garden.

Thyme grows best in full sun. It’s very drought-tolerant. It is also most flavorful when it’s grown in poor soil without a lot of nutrients.
This is not the type of soil most vegetables, including brassicas, prefer. This may add another layer of complication to planting thyme in the vegetable garden, which is why growing thyme in containers is a flexible way to reap the benefits in your garden.
Summary
Thyme offers many obvious benefits to its neighboring plants as well as to the gardener. Figuring out how to get those benefits without creating new problems can present an interesting challenge to the gardener. You may want to try several different approaches and figure out what works best for you.