Carpenter ants comprise several species of highly-social ants in order Camponotus who excavate galleries in wood in which to lay eggs and raise their young. They do not eat the wood. They just excavate galleries in which to lay their eggs.
Depending on the specie, carpenter ants range in size from about 3/8 of an inch to slightly more than an inch in length. Most carpenter ant species are predominantly black in color, but there are variations including reddish, brownish, and deep blue.
In nature, carpenter ants nest outside in galleries excavated in large pieces of wood such as trees and hollow logs. They prefer wood that is somewhat water damaged and with a relatively high moisture level, though not rotten or soaking wet wood. They can also nest in wooden fence posts, firewood, utility poles, PVC pipes, and other man-made hollow objects.
The ants in the picture here are building a nest in a tree. Note the sawdust from the ants' excavation. Exterminators call this "frass," and it's one of the things they look for when diagnosing a carpenter ant problem.
In buildings, carpenter usually build their nests in void areas with a rather high humidity level, such as soffits, wall voids (especially in kitchens and bathrooms), sill plates in basements or crawl spaces, and the spaces around window and door frames. Less often, they may also be found in cinder blocks, tubular curtain rods, electronic equipment, electrical conduit, and rolled-up carpeting. If the area already has a suitable area in which to lay their eggs, they may not do any excavating at all.
Carpenter ants prefer infesting wood that has already been moisture damaged, but is not soaking wet. It is unusual (but not unheard of) for carpenter ants to infest dry, intact wood. Although they can do serious damage to wood, because the wood they infest usually has already been water damaged, it's debatable how much damage they do beyond what was already done by the water.
Carpenter ants will eat almost anything, but their natural diet consists primarily of dead insects, as well as a sugary liquid called honeydew that is secreted by aphids tended and protected by the ants for the purpose of harvesting their honeydew. It's an interesting example of a non-human animal tending another animal for agricultural purposes.
Like ants in general, carpenter ants are social insects with a well-defined caste system:
The queen is the center of a colony, and her primary job is to produce eggs. Queen ants also secrete pheromones that regulate the behavior (and possibly even the biology) of the other members of the colony.
The great majority of members of a carpenter ant colony are workers, whose duties include gathering food, excavating galleries, feeding and tending the reproductives and the young, and defending the colony. The workers are genetic females, although they are wingless and do not reproduce.
Mature colonies also produce winged reproductives, who leave the colony at the appointed time to mate. The males die shortly after the mating flight, and the fertilized females remove their wings and set about looking for a suitable place to build a nest. In nature, this would normally be a tree or tree stump.
There are several species of ants that look almost indistinguishable from carpenter ants, but which live in the soil and don't attack wooden structures.
Variously called "mound ants," "formican ants," "black dirt ants," and many other local names, these ants usually require only a sprinkling of bait for effective control. In fact, if they're located in an out-of-the-way place and don't particularly bother you, there's no reason to kill mound ants at all. They are harmless and they do have their part in the natural ecosystem. (Just make sure you don't mistake them for fire ants, which are far from harmless.)
Once in a while, however, carpenter ants living in a hollow tree stump will burrow through the roots and emerge from the ground, several feet or more from the tree trunk; so it's best not to assume that what look like "mound ants" aren't really carpenter ants, especially if you've also been seeing them in your home.