Ants form symbiotic associations with a range of species, including other ant species, other insects, plants, and fungi. They are preyed on by many animals and even certain fungi.
Aphids and other hemipteran insects secrete a sweet liquid called honeydew when they feed on plant sap. The sugars in honeydew are a high-energy food source, which many ant species collect. In some cases the aphids secrete the honeydew in response to the ants' tapping them with their antennae. The ants in turn keep predators away and will move the aphids between feeding locations. On migrating to a new area, many colonies will take the aphids with them, to ensure a continued supply of honeydew. Ants also tend mealybugs to harvest their honeydew. Mealybugs can become a serious pest of pineapples if ants are present to protect mealybugs from their natural enemies.