They build nests inside wood consisting of galleries chewed out with their mandibles, preferably in dead, damp wood. However, unlike termites, they do not consume wood, discarding a material that resembles sawdust. Sometimes, carpenter ants hollow out sections of trees. They also commonly infest wooden buildings and structures, and are a widespread nuisance and major cause of structural damage. Nevertheless, their ability to excavate wood helps in forest decomposition. One of the most familiar species associated with human habitation in the United States is the black carpenter ant (Camponotus pennsylvanicus). The genus includes over 1,000 species. They also farm aphids. In the farming, the ants protect the aphids while they excrete a sugary fluid called honeydew, which the ants get by stroking the aphids with their antennae.
All ants in this genus, and some related genera, possess an obligate bacterial endosymbiont called Blochmannia. This bacterium has a small genome, and retains genes to biosynthesize essential amino acids and other nutrients. This suggests the bacterium plays a role in ant nutrition. Many Camponotus species are also infected with Wolbachia, another endosymbiont that is widespread across insect groups.