Carpenter ants are attracted to both food sources and nesting sites. They are particularly drawn to moist or decaying wood, which they excavate to create their nests. Carpenter ants also forage for food indoors, seeking out sweet or protein-based foods such as sugary drinks, fruit, meat, and pet food. Additionally, they may be attracted to homes with high levels of moisture or wood that has been damaged by water, as these conditions provide suitable nesting sites.