Answer: The ants you see may not be doing any harm
themselves, but if you look more closely, you may see that
they are hanging
out with aphids, which are tiny insects that feed in masses on
plant parts. They are sometimes called plant lice (this give
you an idea as to their size!); they are small, oval insects that
congregate on new growth. Some ants actually feed on the
waste product of aphids, called honeydew, because it is
very sweet. If you can control the primary problem--usually
aphids--you might just control the ants as well. If you find aphids, you can control them by washing them off with water from the garden hose, or with insecticidal soap, being sure to follow the label instructions.
Tansy (Tanacetum) is an old time herb plant said to repel ants and was thus grown by the door to keep them out of the house. This plant spreads rapidly and could become an invasive pest in the good soil of the vegetable garden, so if you want to grow it and see if it repels ants for you, consider trying it in a leaner, dryish soil in full sun.
Q&A Library Searching Tips