When people tell me they have ants indoors, I ask how big. If they say small, they're probably pavement ants or odorous house ants that are nesting in the cement of the floor or foundation. If they say big, well, then I know the building is in need of repair. Often I'll ask if the ceiling leaked last time it rained--usually it did. These eastern black carpenter ants Camponotus pennsylvanicus* only move in if there's some nice water-damaged wood for them to nest in.
The main nest is in the dead part of a live tree. The ants travel across the branches at night, into the upper levels of wood construction of a building. If there's water damaged wood they can work with their mandibles, they'll bring over several dozen of their larvae. They bring the larvae not just to have a ready-made supply of new workers, but to help them eat. Adult ants can't eat solid food, so they bring bits of insects to the larvae, who chew them up and regurgitate liquid the adults can lap up. Besides dead insects, carpenter ants like sugar-rich foods, like aphid honeydew and discarded and carelessly stored human food.
Carpenter ants are a critical part of the forest ecosystem. They move into trees that have been weakened by fungi to build their nests. Large woodpeckers come to feed on the colony, opening up cavities in the dead wood. Cavity nesting birds depend on these sites to reproduce. Wood ducks, for example, are unable to make their own cavities in which to nest, and thus depend on woodpeckers, carpenter ants, and wood decaying fungi in order to successfully reproduce.
*
Camponotus means "flat back", referring to the flattened or weakly curved dorsal mesosomal profile of most Northern Hemisphere species.